Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b06322e

Browse files
Fix after-rebase errors
1 parent ae6042f commit b06322e

File tree

7 files changed

+49
-42
lines changed

7 files changed

+49
-42
lines changed

‎client/package.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@
6868
"scripts": {
6969
"test": "echo \"Error: no test specified\" && exit 1",
7070
"start": "node server.js",
71-
"build:client": "NODE_ENV=production webpack --config webpack.rails.config.js",
72-
"build:server": "NODE_ENV=production webpack --config webpack.server.config.js",
73-
"build:dev:client": "webpack -w --config webpack.rails.config.js",
74-
"build:dev:client": "webpack -w --config webpack.server.config.js",
71+
"build:client": "NODE_ENV=production webpack --config webpack.client.rails.config.js",
72+
"build:server": "NODE_ENV=production webpack --config webpack.server.rails.config.js",
73+
"build:dev:client": "webpack -w --config webpack.client.rails.config.js",
74+
"build:dev:server": "webpack -w --config webpack.server.rails.config.js",
7575
"lint": "npm run eslint && npm run jscs",
7676
"eslint": "eslint --ext .js,.jsx .",
7777
"jscs": "jscs --verbose ."

‎client/server.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
var bodyParser = require('body-parser');
33
var webpack = require('webpack');
44
var WebpackDevServer = require('webpack-dev-server');
5-
var config = require('./webpack.hot.config');
5+
var config = require('./webpack.client.hot.config');
66
var sleep = require('sleep');
77

88
var comments = [

‎client/webpack.common.config.js‎ renamed to ‎client/webpack.client.base.config.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ module.exports = {
88
// the project dir
99
context: __dirname,
1010
entry: {
11-
vendor: [],
11+
vendor: [
12+
'jquery',
13+
'jquery-ujs',
14+
],
1215
app: [],
1316
},
1417
resolve: {
@@ -31,6 +34,8 @@ module.exports = {
3134

3235
// React is necessary for the client rendering:
3336
{test: require.resolve('react'), loader: 'expose?React'},
37+
{test: require.resolve('jquery'), loader: 'expose?jQuery'},
38+
{test: require.resolve('jquery'), loader: 'expose?$'},
3439
],
3540
},
3641
};

‎client/webpack.hot.config.js‎ renamed to ‎client/webpack.client.hot.config.js‎

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@
33

44
const webpack = require('webpack');
55
const path = require('path');
6-
const config = require('./webpack.common.config');
6+
const config = require('./webpack.client.base.config');
77

88
// We're using the bootstrap-sass loader.
99
// See: https://github.com/shakacode/bootstrap-sass-loader
10-
config.entry.vendor.push(
11-
'jquery',
12-
'jquery-ujs',
13-
14-
// custom bootstrap
15-
'bootstrap-sass!./bootstrap-sass.config.js'
16-
);
17-
config.entry.app.unshift(
10+
config.entry.vendor.push('bootstrap-sass!./bootstrap-sass.config.js');
11+
config.entry.app.push(
1812
'webpack-dev-server/client?http://localhost:3000',
1913
'webpack/hot/dev-server',
2014
'./scripts/webpack_only',
@@ -36,10 +30,6 @@ config.resolve.root.push(path.join(__dirname, 'assets/stylesheets'));
3630
// All the styling loaders only apply to hot-reload, not rails
3731
config.module.loaders.push(
3832
{test: /\.jsx?$/, loaders: ['react-hot', 'babel'], exclude: /node_modules/},
39-
40-
{test: require.resolve('jquery'), loader: 'expose?jQuery'},
41-
{test: require.resolve('jquery'), loader: 'expose?$'},
42-
4333
{test: /\.css$/, loader: 'style-loader!css-loader'},
4434
{
4535
test: /\.scss$/,

‎client/webpack.rails.config.js‎ renamed to ‎client/webpack.client.rails.config.js‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// NOTE: All style sheets handled by the asset pipeline in rails
66

77
const webpack = require('webpack');
8-
const config = require('./webpack.common.config');
8+
const config = require('./webpack.client.base.config');
99

1010
const devBuild = process.env.NODE_ENV !== 'production';
1111

@@ -15,19 +15,13 @@ config.output = {
1515
};
1616

1717
// You can add entry points specific to rails here
18-
config.entry.vendor.push(
19-
'./scripts/rails_only',
20-
'jquery',
21-
'jquery-ujs'
22-
);
18+
config.entry.vendor.unshift('./scripts/rails_only');
2319
config.entry.app.push('./assets/javascripts/clientGlobals');
2420

2521
// See webpack.common.config for adding modules common to both the webpack dev server and rails
2622

2723
config.module.loaders.push(
28-
{test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader'},
29-
{test: require.resolve('jquery'), loader: 'expose?jQuery'},
30-
{test: require.resolve('jquery'), loader: 'expose?$'}
24+
{test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/}
3125
);
3226

3327
module.exports = config;

‎client/webpack.server.config.js‎

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Common webpack configuration used by webpack.hot.config and webpack.rails.config.
2+
3+
const path = require('path');
4+
5+
module.exports = {
6+
7+
// the project dir
8+
context: __dirname,
9+
entry: ['./assets/javascripts/serverGlobals'],
10+
output: {
11+
filename: 'server-bundle.js',
12+
path: '../app/assets/javascripts/generated',
13+
14+
// CRITICAL for enabling Rails to find the globally exposed variables.
15+
libaryTarget: 'this',
16+
},
17+
resolve: {
18+
root: [
19+
path.join(__dirname, 'scripts'),
20+
path.join(__dirname, 'assets/javascripts'),
21+
],
22+
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', 'config.js'],
23+
},
24+
module: {
25+
loaders: [
26+
{test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/},
27+
28+
// React is necessary for the client rendering:
29+
{test: require.resolve('react'), loader: 'expose?React'},
30+
],
31+
},
32+
};

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /