Skip to content

Commit 45263fd

Browse files
author
Emmanouil Konstantinidis
committed
Split up webpack configs
1 parent 3166f90 commit 45263fd

File tree

5 files changed

+26
-15
lines changed

5 files changed

+26
-15
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ dist/
1010
drfdocs.egg-info/
1111

1212
rest_framework_docs/static/node_modules/
13+
rest_framework_docs/static/rest_framework_docs/js/dist.js.map

rest_framework_docs/static/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"watch-js": "webpack --progress --colors --watch",
1212
"watch-less": "watch 'npm run build-less' rest_framework_docs/less/",
1313
"watch": "npm run watch-js & npm run watch-less",
14-
"build": "npm run build-font-awesome && npm run build-bootstrap-fonts && npm run build-less",
14+
"build": "npm run build-font-awesome && npm run build-bootstrap-fonts && npm run build-js && npm run build-less",
15+
"release-js": "webpack --config webpack.rel.config.js",
16+
"release": "npm run build-font-awesome && npm run build-bootstrap-fonts && npm run release-js && npm run build-less",
1517
"start": "npm run build && npm run watch-less",
1618
"lint": "eslint 'rest_framework_docs/js/' --ignore-pattern 'rest_framework_docs/js/dist.js'",
1719
"test": "npm run lint"

rest_framework_docs/static/rest_framework_docs/js/dist.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rest_framework_docs/static/webpack.config.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// var path = require('path');
21
var webpack = require('webpack');
32

43
module.exports = {
@@ -8,22 +7,13 @@ module.exports = {
87
path: __dirname + '/rest_framework_docs/js',
98
filename: 'dist.js'
109
},
10+
devtool: 'source-map',
1111
plugins: [
12-
new webpack.optimize.UglifyJsPlugin({
13-
compress: {
14-
warnings: false,
15-
},
16-
output: {
17-
comments: false,
18-
sourceMap: false
19-
}
20-
}),
2112
new webpack.NoErrorsPlugin()
2213
],
2314
module: {
2415
loaders: [{
2516
test: /\.js?$/,
26-
// include: path.join(__dirname, '/rest_framework_docs/js'),
2717
exclude: /node_modules/,
2818
loader: 'babel',
2919
query: {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
var webpack = require('webpack');
2+
var config = require('./webpack.config.js');
3+
4+
config.devtool = '';
5+
6+
config.plugins = config.plugins.concat([
7+
new webpack.optimize.UglifyJsPlugin({
8+
compress: {
9+
warnings: false,
10+
},
11+
output: {
12+
comments: false,
13+
}
14+
}),
15+
new webpack.NoErrorsPlugin()
16+
]);
17+
18+
module.exports = config;

0 commit comments

Comments
 (0)