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/common.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/common.js')
-rw-r--r-- | app/config/webpack/common.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/app/config/webpack/common.js b/app/config/webpack/common.js new file mode 100644 index 00000000..4f5739f0 --- /dev/null +++ b/app/config/webpack/common.js | |||
@@ -0,0 +1,40 @@ | |||
1 | const path = require('path'); | ||
2 | const webpack = require('webpack'); | ||
3 | const StyleLintPlugin = require('stylelint-webpack-plugin'); | ||
4 | |||
5 | const rootDir = path.resolve(__dirname, '../../../'); | ||
6 | |||
7 | module.exports = function() { | ||
8 | return { | ||
9 | entry: { | ||
10 | material: path.join(rootDir, './app/Resources/static/themes/material/index.js'), | ||
11 | baggy: path.join(rootDir, './app/Resources/static/themes/baggy/index.js'), | ||
12 | }, | ||
13 | |||
14 | output: { | ||
15 | filename: '[name].js', | ||
16 | path: path.resolve(rootDir, 'web/bundles/wallabagcore'), | ||
17 | publicPath: '/bundles/wallabagcore/', | ||
18 | }, | ||
19 | plugins: [ | ||
20 | new webpack.ProvidePlugin({ | ||
21 | $: 'jquery', | ||
22 | jQuery: 'jquery', | ||
23 | 'window.$': 'jquery', | ||
24 | 'window.jQuery': 'jquery' | ||
25 | }), | ||
26 | new StyleLintPlugin({ | ||
27 | configFile: '.stylelintrc', | ||
28 | failOnError: false, | ||
29 | quiet: false, | ||
30 | context: 'app/Resources/static/themes', | ||
31 | files: '**/*.scss', | ||
32 | }), | ||
33 | ], | ||
34 | resolve: { | ||
35 | alias: { | ||
36 | jquery: path.join(rootDir, 'node_modules/jquery/dist/jquery.js') | ||
37 | } | ||
38 | }, | ||
39 | }; | ||
40 | }; | ||