Skip to content

Commit 183ce15

Browse files
committed
Configure babel to include our js files for es5 transpiling
#238 (comment)
1 parent 02c7192 commit 183ce15

File tree

9 files changed

+55
-27
lines changed

9 files changed

+55
-27
lines changed

builder/config/webpack/production.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,15 @@ environment.config.set("output.filename", chunkData => {
1212
const miniCssExtractPlugin = environment.plugins.get('MiniCssExtract')
1313
miniCssExtractPlugin.options.filename = "[name].min.css"
1414

15+
// In order to have babel's es5 (ie11) transpiling be applied to all of the
16+
// js code, it needs to be included in the loader paths.
17+
// https://github.com/rails/webpacker/blob/master/docs/webpack.md
18+
// https://github.com/matestack/matestack-ui-core/issues/238
19+
//
20+
const babelLoader = environment.loaders.get('babel')
21+
delete babelLoader.exclude
22+
const path = require('path')
23+
babelLoader.include.push(path.resolve(__dirname, '../../../node_modules'))
24+
babelLoader.include.push(path.resolve(__dirname, '../../../app/concepts/matestack/ui/core'))
1525

1626
module.exports = environment.toWebpackConfig()

vendor/assets/javascripts/dist/matestack-ui-core.js

Lines changed: 42 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/assets/javascripts/dist/matestack-ui-core.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/assets/javascripts/dist/matestack-ui-core.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
21 Bytes
Binary file not shown.
65 Bytes
Binary file not shown.

vendor/assets/javascripts/dist/matestack-ui-core.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
632 Bytes
Binary file not shown.
723 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)