Created
March 12, 2019 09:07
-
-
Save janwirth/7080dd284d4aa87741ccbb78a22005f6 to your computer and use it in GitHub Desktop.
Edit babel configuration in create-elm-app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
configureWebpack: (config, env) => { | |
const rules = config.module.rules | |
rules | |
.map(r => { | |
// find js rule | |
if (r.test && r.test.toString().indexOf('js') > -1) { | |
// find the rule with the actual babel config | |
if (r.use) { | |
r.use[0].options.plugins = r.use[0].options.plugins || [] | |
r.use[0].options.plugins.push('@babel/plugin-syntax-dynamic-import') | |
} | |
} | |
}) | |
return config | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment