Skip to content

Commit 3166f90

Browse files
author
Emmanouil Konstantinidis
committed
Move to webpack
1 parent 83a017a commit 3166f90

File tree

4 files changed

+51
-555
lines changed

4 files changed

+51
-555
lines changed

rest_framework_docs/static/package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"scripts": {
77
"build-font-awesome": "cp -r node_modules/font-awesome/fonts rest_framework_docs/",
88
"build-bootstrap-fonts": "cp -r node_modules/bootstrap/fonts rest_framework_docs/",
9-
"build-js": "browserify rest_framework_docs/js/index.js -t [ babelify --presets [ es2015 react ] ] -d -p [ minifyify --map rest_framework_docs/js/dist.map.json --output rest_framework_docs/js/dist.map.json ] > rest_framework_docs/js/dist.js",
9+
"build-js": "webpack",
1010
"build-less": "lessc --clean-css rest_framework_docs/less/style.less rest_framework_docs/css/style.css",
11-
"watch-js": "watchify rest_framework_docs/js/index.js -t [ babelify --presets [ es2015 react ] ] -d -p [ minifyify --map rest_framework_docs/js/dist.map.json --output rest_framework_docs/js/dist.map.json ] -o rest_framework_docs/js/dist.js -v",
11+
"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",
1414
"build": "npm run build-font-awesome && npm run build-bootstrap-fonts && npm run build-less",
@@ -33,12 +33,8 @@
3333
},
3434
"homepage": "https://www.drfdocs.com/",
3535
"dependencies": {
36-
"babel-preset-es2015": "=6.3.13",
37-
"babel-preset-react": "=6.3.13",
38-
"babelify": "=7.2.0",
3936
"bootstrap": "=3.3.6",
4037
"bootswatch": "=3.3.6",
41-
"browserify": "=12.0.1",
4238
"font-awesome": "=4.5.0",
4339
"jquery": "=1.11.3",
4440
"react": "=0.14.3",
@@ -49,13 +45,16 @@
4945
"underscore.string": "=3.2.2"
5046
},
5147
"devDependencies": {
48+
"babel-core": "=6.3.26",
5249
"babel-eslint": "=4.1.6",
50+
"babel-loader": "=6.2.0",
51+
"babel-preset-es2015": "=6.3.13",
52+
"babel-preset-react": "^6.3.13",
5353
"eslint": "=1.10.3",
5454
"eslint-plugin-react": "=3.11.3",
5555
"less": "=2.5.3",
5656
"less-plugin-clean-css": "=1.5.1",
57-
"minifyify": "=7.1.0",
5857
"watch": "=0.16.0",
59-
"watchify": "=3.6.1"
58+
"webpack": "=1.12.9"
6059
}
6160
}

rest_framework_docs/static/rest_framework_docs/js/dist.js

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

rest_framework_docs/static/rest_framework_docs/js/dist.map.json

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// var path = require('path');
2+
var webpack = require('webpack');
3+
4+
module.exports = {
5+
context: __dirname + '/rest_framework_docs/js',
6+
entry: './index.js',
7+
output: {
8+
path: __dirname + '/rest_framework_docs/js',
9+
filename: 'dist.js'
10+
},
11+
plugins: [
12+
new webpack.optimize.UglifyJsPlugin({
13+
compress: {
14+
warnings: false,
15+
},
16+
output: {
17+
comments: false,
18+
sourceMap: false
19+
}
20+
}),
21+
new webpack.NoErrorsPlugin()
22+
],
23+
module: {
24+
loaders: [{
25+
test: /\.js?$/,
26+
// include: path.join(__dirname, '/rest_framework_docs/js'),
27+
exclude: /node_modules/,
28+
loader: 'babel',
29+
query: {
30+
presets: ['es2015', 'react']
31+
}
32+
}]
33+
}
34+
};

0 commit comments

Comments
 (0)