Skip to content

Commit 39decd7

Browse files
committed
Only add jquery-ujs for rails webpack config file
1 parent a9b7d47 commit 39decd7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/generators/react_on_rails/templates/base/base/client/webpack.client.base.config.js.tt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ module.exports = {
1717
vendor: [
1818
'babel-core/polyfill',
1919
'jquery',
20-
'jquery-ujs',
2120
'react',
2221
'react-dom',
2322
],

lib/generators/react_on_rails/templates/base/base/client/webpack.client.rails.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ config.output = {
1616
// You can add entry points specific to rails here
1717
config.entry.vendor.unshift(
1818
'es5-shim/es5-shim',
19-
'es5-shim/es5-sham'
19+
'es5-shim/es5-sham',
2020
);
2121

22-
// See webpack.common.config for adding modules common to both the webpack dev server and rails
22+
// jquery-ujs MUST GO AFTER jquery, so must use 'push'
23+
config.entry.app.push('jquery-ujs');
2324

25+
// See webpack.common.config for adding modules common to both the webpack dev server and rails
2426
config.module.loaders.push(
2527
{test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/},
2628
{test: require.resolve('react'), loader: 'imports?shim=es5-shim/es5-shim&sham=es5-shim/es5-sham'}

0 commit comments

Comments
 (0)