Skip to content

ES5 transpiling #369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 10, 2020
Merged
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
10 changes: 8 additions & 2 deletions app/javascript/packs/matestack-ui-core.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
require('../matestack-ui-core/index')
module.exports = MatestackUiCore
// // Add polyfills for the asset pipeline
// // https://github.com/matestack/matestack-ui-core/issues/238#issuecomment-583905838
//
// import 'core-js/stable'
// import 'regenerator-runtime/runtime'

import '../matestack-ui-core/index'
export default MatestackUiCore
10 changes: 10 additions & 0 deletions builder/config/webpack/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,15 @@ environment.config.set("output.filename", chunkData => {
const miniCssExtractPlugin = environment.plugins.get('MiniCssExtract')
miniCssExtractPlugin.options.filename = "[name].min.css"

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

module.exports = environment.toWebpackConfig()
2 changes: 1 addition & 1 deletion builder/config/webpacker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ default: &default

# Additional paths webpack should lookup modules
# ['app/assets', 'engine/foo/app/assets']
resolved_paths: []
resolved_paths: ['./node_modules']

# Reload manifest.json on all requests so we reload latest compiled packs
cache_manifest: false
Expand Down
66 changes: 42 additions & 24 deletions vendor/assets/javascripts/dist/matestack-ui-core.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/assets/javascripts/dist/matestack-ui-core.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vendor/assets/javascripts/dist/matestack-ui-core.min.js

Large diffs are not rendered by default.

Binary file modified vendor/assets/javascripts/dist/matestack-ui-core.min.js.br
Binary file not shown.
Binary file modified vendor/assets/javascripts/dist/matestack-ui-core.min.js.gz
Binary file not shown.

Large diffs are not rendered by default.

Binary file modified vendor/assets/javascripts/dist/matestack-ui-core.min.js.map.br
Binary file not shown.
Binary file modified vendor/assets/javascripts/dist/matestack-ui-core.min.js.map.gz
Binary file not shown.
9 changes: 0 additions & 9 deletions vendor/assets/javascripts/matestack-ui-core.js.map

This file was deleted.