diff options
author | Thomas Citharel <tcit@tcit.fr> | 2017-05-09 11:43:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-09 11:43:48 +0200 |
commit | b28c5430efefa63d04d87404c99798e82d0427e4 (patch) | |
tree | 0bf158fb56120be6624fa26639a28beb84a6598e /app/config/webpack/dev.js | |
parent | 43f81a62e93fb20c7af619a5132276706e989c62 (diff) | |
parent | efac66cb56d650b863b64c9c4582589da6a2442a (diff) | |
download | wallabag-b28c5430efefa63d04d87404c99798e82d0427e4.tar.gz wallabag-b28c5430efefa63d04d87404c99798e82d0427e4.tar.zst wallabag-b28c5430efefa63d04d87404c99798e82d0427e4.zip |
Merge pull request #3022 from wallabag/webpack
Adds Webpack support and remove Grunt
Diffstat (limited to 'app/config/webpack/dev.js')
-rw-r--r-- | app/config/webpack/dev.js | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/app/config/webpack/dev.js b/app/config/webpack/dev.js new file mode 100644 index 00000000..771df65b --- /dev/null +++ b/app/config/webpack/dev.js | |||
@@ -0,0 +1,62 @@ | |||
1 | const webpackMerge = require('webpack-merge'); | ||
2 | const webpack = require('webpack'); | ||
3 | const path = require('path'); | ||
4 | const commonConfig = require('./common.js'); | ||
5 | |||
6 | module.exports = function () { | ||
7 | return webpackMerge(commonConfig(), { | ||
8 | devtool: 'eval-source-map', | ||
9 | output: { | ||
10 | filename: '[name].dev.js' | ||
11 | }, | ||
12 | |||
13 | devServer: { | ||
14 | hot: true, | ||
15 | // enable HMR on the server | ||
16 | |||
17 | contentBase: './web', | ||
18 | // match the output path | ||
19 | }, | ||
20 | plugins: [ | ||
21 | new webpack.HotModuleReplacementPlugin(), | ||
22 | ], | ||
23 | module: { | ||
24 | rules: [ | ||
25 | { | ||
26 | enforce: 'pre', | ||
27 | test: /\.js$/, | ||
28 | loader: 'eslint-loader', | ||
29 | exclude: /node_modules/, | ||
30 | }, | ||
31 | { | ||
32 | test: /\.js$/, | ||
33 | exclude: /(node_modules)/, | ||
34 | use: { | ||
35 | loader: 'babel-loader', | ||
36 | options: { | ||
37 | presets: ['env'] | ||
38 | } | ||
39 | } | ||
40 | }, | ||
41 | { | ||
42 | test: /\.(s)?css$/, | ||
43 | use: [ | ||
44 | 'style-loader', | ||
45 | { | ||
46 | loader: 'css-loader', | ||
47 | options: { | ||
48 | importLoaders: 1, | ||
49 | } | ||
50 | }, | ||
51 | 'postcss-loader', | ||
52 | 'sass-loader' | ||
53 | ] | ||
54 | }, | ||
55 | { | ||
56 | test: /\.(jpg|png|gif|svg|eot|ttf|woff|woff2)$/, | ||
57 | use: 'url-loader' | ||
58 | }, | ||
59 | ] | ||
60 | }, | ||
61 | }) | ||
62 | }; | ||