Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

compile the bundled code to es5 to work in IE11 #912

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion config/karma.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module.exports.getBaseKarmaConfig = function (opts = { ignoreBower: false }) {

// list of files / patterns to load in the browser
files: [
require.resolve('@babel/polyfill/dist/polyfill.js'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably shouldn't include this in our tests as then our tests won't catch when we have forgotten to define a required polyfill in origami.json -- I think those polyfills are included?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to in order to get async functions working which seem to require the regenerator runtime. I couldn't get it to work any other way.

'test/*.js',
'test/**/*.js',
'main.scss'
Expand All @@ -63,9 +64,18 @@ module.exports.getBaseKarmaConfig = function (opts = { ignoreBower: false }) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'test/**/*.js': ['scrumple', 'sourcemap'],
'test/**/*.js': ['scrumple', 'babel', 'sourcemap'],
'main.scss': ['scss']
},
babelPreprocessor: {
options: {
presets: [require.resolve('@babel/preset-env')],
sourceMap: 'inline'
},
sourceFileName: function (file) {
return file.originalPath;
}
},
scssPreprocessor: {
options: {
file: '',
Expand Down
Loading