Skip to content

Commit 0b65c13

Browse files
authored
Merge pull request #369 from matestack/sf/es5-javascript
ES5 transpiling
2 parents 2337d87 + 72c903c commit 0b65c13

12 files changed

+64
-39
lines changed
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
require('../matestack-ui-core/index')
2-
module.exports = MatestackUiCore
1+
// // Add polyfills for the asset pipeline
2+
// // https://github.com/matestack/matestack-ui-core/issues/238#issuecomment-583905838
3+
//
4+
// import 'core-js/stable'
5+
// import 'regenerator-runtime/runtime'
6+
7+
import '../matestack-ui-core/index'
8+
export default MatestackUiCore

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()

builder/config/webpacker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ default: &default
1111

1212
# Additional paths webpack should lookup modules
1313
# ['app/assets', 'engine/foo/app/assets']
14-
resolved_paths: []
14+
resolved_paths: ['./node_modules']
1515

1616
# Reload manifest.json on all requests so we reload latest compiled packs
1717
cache_manifest: false

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.

0 commit comments

Comments
 (0)