Skip to content

Commit c802b6d

Browse files
committed
Add --downlevel option to manually enable IE9+ compat
1 parent a656ed7 commit c802b6d

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/cli.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ prog
1717
.version(version)
1818
.option('--files', 'Minimatch pattern for test files')
1919
.option('--headless', 'Run using Chrome Headless', true)
20-
.option('--coverage', 'Report code coverage of tests', true);
20+
.option('--coverage', 'Report code coverage of tests', true)
21+
.option('--downlevel', 'Downlevel syntax to ES5');
2122

2223
prog
2324
.command('run [...files]', '', { default: true })

src/configure.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const WEBPACK_MAJOR = parseInt(WEBPACK_VERSION.split('.')[0], 10);
1717
* @param {Boolean} [options.watch=false] - Start a continuous test server and retest when files change
1818
* @param {Boolean} [options.coverage=false] - Instrument and collect code coverage statistics
1919
* @param {Object} [options.webpackConfig] - Custom webpack configuration
20+
* @param {Boolean} [options.downlevel=false] - Downlevel/transpile syntax to ES5
2021
*/
2122
export default function configure(options) {
2223
let cwd = process.cwd(),
@@ -235,6 +236,7 @@ export default function configure(options) {
235236

236237
webpack: {
237238
devtool: 'cheap-module-eval-source-map',
239+
// devtool: 'module-source-map',
238240
mode: webpackConfig.mode || 'development',
239241
module: {
240242
// @TODO check webpack version and use loaders VS rules as the key here appropriately:

src/lib/babel-loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function babelLoader(options) {
1010
browsers: [
1111
'last 2 Chrome versions',
1212
'last 2 Firefox versions',
13-
options.browsers && String(options.browsers).match(/(\bie(\b|\d)|internet.explorer)/gi) && 'ie>=9'
13+
(options.downlevel || options.browsers && String(options.browsers).match(/(\bie(\b|\d)|internet.explorer)/gi)) && 'ie>=9'
1414
].filter(Boolean)
1515
},
1616
corejs: 2,

0 commit comments

Comments
 (0)