Skip to content

Commit 3f8bd65

Browse files
committed
Updated examples to not store webpack config and stats file as static assets as they don't need to be server to the browser
1 parent 6e60253 commit 3f8bd65

File tree

17 files changed

+24
-21
lines changed

17 files changed

+24
-21
lines changed

examples/code-splitting/app/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,5 @@
109109

110110
WEBPACK_LOADER = {
111111
'BUNDLE_DIR_NAME': 'bundles/',
112-
'STATS_FILE': os.path.join(BASE_DIR, 'assets/webpack-stats.json'),
112+
'STATS_FILE': os.path.join(BASE_DIR, 'webpack-stats.json'),
113113
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"status":"done","chunks":{"main":[{"name":"main-7a1ed5e12a8b692a5010.js","path":"/home/owais/Projects/django-webpack-loader/examples/code-splitting/assets/bundles/main-7a1ed5e12a8b692a5010.js"}],"vendor":[{"name":"vendor-7a1ed5e12a8b692a5010.js","path":"/home/owais/Projects/django-webpack-loader/examples/code-splitting/assets/bundles/vendor-7a1ed5e12a8b692a5010.js"}]}}

examples/code-splitting/assets/webpack.config.js renamed to examples/code-splitting/webpack.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ var SplitByPathPlugin = require('webpack-split-by-path');
66

77
module.exports = {
88
context: __dirname,
9-
entry: './js/index',
9+
entry: './assets/js/index',
1010
output: {
1111
path: path.resolve('./assets/bundles/'),
1212
filename: "[name]-[hash].js",
1313
chunkFilename: "[name]-[hash].js"
1414
},
1515

1616
plugins: [
17-
new BundleTracker({filename: './assets/webpack-stats.json'}),
17+
new BundleTracker({filename: './webpack-stats.json'}),
1818
new SplitByPathPlugin([
1919
{
2020
name: 'vendor',
21-
path: path.join(__dirname, '../node_modules/')
21+
path: path.join(__dirname, './node_modules/')
2222
}
2323
])
2424
],

examples/hot-reload/app/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,5 @@
109109

110110
WEBPACK_LOADER = {
111111
'BUNDLE_DIR_NAME': 'bundles/',
112-
'STATS_FILE': os.path.join(BASE_DIR, 'assets/webpack-stats.json'),
112+
'STATS_FILE': os.path.join(BASE_DIR, 'webpack-stats.json'),
113113
}

examples/hot-reload/assets/js/app.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ var React = require('react');
22

33
module.exports = React.createClass({
44
render: function(){
5-
return <h1>Hello, rld.</h1>
5+
return <h1>Hello, world.</h1>
66
}
77
});

examples/hot-reload/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var webpack = require('webpack');
22
var WebpackDevServer = require('webpack-dev-server');
3-
var config = require('./assets/webpack.config');
3+
var config = require('./webpack.config');
44

55
new WebpackDevServer(webpack(config), {
66
publicPath: config.output.publicPath,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"status":"done","chunks":{"main":[{"name":"main-0b89cae2135dfffae4ee.js","publicPath":"http://localhost:3000/assets/bundles/main-0b89cae2135dfffae4ee.js","path":"/home/owais/Projects/django-webpack-loader/examples/hot-reload/assets/bundles/main-0b89cae2135dfffae4ee.js"}]}}

examples/hot-reload/assets/webpack.config.js renamed to examples/hot-reload/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
entry: [
99
'webpack-dev-server/client?http://localhost:3000',
1010
'webpack/hot/only-dev-server',
11-
'./js/index'
11+
'./assets/js/index'
1212
],
1313
output: {
1414
path: path.resolve('./assets/bundles/'),
@@ -19,7 +19,7 @@ module.exports = {
1919
plugins: [
2020
new webpack.HotModuleReplacementPlugin(),
2121
new webpack.NoErrorsPlugin(), // don't reload if there is an error
22-
new BundleTracker({filename: './assets/webpack-stats.json'}),
22+
new BundleTracker({filename: './webpack-stats.json'}),
2323
],
2424

2525
module: {

examples/simple/app/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,5 @@
109109

110110
WEBPACK_LOADER = {
111111
'BUNDLE_DIR_NAME': 'bundles/',
112-
'STATS_FILE': os.path.join(BASE_DIR, 'assets/webpack-stats.json'),
112+
'STATS_FILE': os.path.join(BASE_DIR, 'webpack-stats.json'),
113113
}

examples/simple/webpack-stats.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"status":"done","chunks":{"main":[{"name":"main-138241749fd8bae1f626.js","path":"/home/owais/Projects/django-webpack-loader/examples/simple/assets/bundles/main-138241749fd8bae1f626.js"}]}}

0 commit comments

Comments
 (0)