diff options
Diffstat (limited to 'app/config/webpack')
-rw-r--r-- | app/config/webpack/common.js | 10 | ||||
-rw-r--r-- | app/config/webpack/dev.js | 23 | ||||
-rw-r--r-- | app/config/webpack/prod.js | 50 |
3 files changed, 41 insertions, 42 deletions
diff --git a/app/config/webpack/common.js b/app/config/webpack/common.js index 4f5739f0..c497689a 100644 --- a/app/config/webpack/common.js +++ b/app/config/webpack/common.js | |||
@@ -4,13 +4,13 @@ const StyleLintPlugin = require('stylelint-webpack-plugin'); | |||
4 | 4 | ||
5 | const rootDir = path.resolve(__dirname, '../../../'); | 5 | const rootDir = path.resolve(__dirname, '../../../'); |
6 | 6 | ||
7 | module.exports = function() { | 7 | module.exports = function () { |
8 | return { | 8 | return { |
9 | entry: { | 9 | entry: { |
10 | material: path.join(rootDir, './app/Resources/static/themes/material/index.js'), | 10 | material: path.join(rootDir, './app/Resources/static/themes/material/index.js'), |
11 | baggy: path.join(rootDir, './app/Resources/static/themes/baggy/index.js'), | 11 | baggy: path.join(rootDir, './app/Resources/static/themes/baggy/index.js'), |
12 | public: path.join(rootDir, './app/Resources/static/themes/_global/share.js'), | ||
12 | }, | 13 | }, |
13 | |||
14 | output: { | 14 | output: { |
15 | filename: '[name].js', | 15 | filename: '[name].js', |
16 | path: path.resolve(rootDir, 'web/bundles/wallabagcore'), | 16 | path: path.resolve(rootDir, 'web/bundles/wallabagcore'), |
@@ -21,7 +21,7 @@ module.exports = function() { | |||
21 | $: 'jquery', | 21 | $: 'jquery', |
22 | jQuery: 'jquery', | 22 | jQuery: 'jquery', |
23 | 'window.$': 'jquery', | 23 | 'window.$': 'jquery', |
24 | 'window.jQuery': 'jquery' | 24 | 'window.jQuery': 'jquery', |
25 | }), | 25 | }), |
26 | new StyleLintPlugin({ | 26 | new StyleLintPlugin({ |
27 | configFile: '.stylelintrc', | 27 | configFile: '.stylelintrc', |
@@ -33,8 +33,8 @@ module.exports = function() { | |||
33 | ], | 33 | ], |
34 | resolve: { | 34 | resolve: { |
35 | alias: { | 35 | alias: { |
36 | jquery: path.join(rootDir, 'node_modules/jquery/dist/jquery.js') | 36 | jquery: path.join(rootDir, 'node_modules/jquery/dist/jquery.js'), |
37 | } | 37 | }, |
38 | }, | 38 | }, |
39 | }; | 39 | }; |
40 | }; | 40 | }; |
diff --git a/app/config/webpack/dev.js b/app/config/webpack/dev.js index 771df65b..b6551152 100644 --- a/app/config/webpack/dev.js +++ b/app/config/webpack/dev.js | |||
@@ -1,13 +1,12 @@ | |||
1 | const webpackMerge = require('webpack-merge'); | 1 | const webpackMerge = require('webpack-merge'); |
2 | const webpack = require('webpack'); | 2 | const webpack = require('webpack'); |
3 | const path = require('path'); | ||
4 | const commonConfig = require('./common.js'); | 3 | const commonConfig = require('./common.js'); |
5 | 4 | ||
6 | module.exports = function () { | 5 | module.exports = function () { |
7 | return webpackMerge(commonConfig(), { | 6 | return webpackMerge(commonConfig(), { |
8 | devtool: 'eval-source-map', | 7 | devtool: 'eval-source-map', |
9 | output: { | 8 | output: { |
10 | filename: '[name].dev.js' | 9 | filename: '[name].dev.js', |
11 | }, | 10 | }, |
12 | 11 | ||
13 | devServer: { | 12 | devServer: { |
@@ -34,9 +33,9 @@ module.exports = function () { | |||
34 | use: { | 33 | use: { |
35 | loader: 'babel-loader', | 34 | loader: 'babel-loader', |
36 | options: { | 35 | options: { |
37 | presets: ['env'] | 36 | presets: ['env'], |
38 | } | 37 | }, |
39 | } | 38 | }, |
40 | }, | 39 | }, |
41 | { | 40 | { |
42 | test: /\.(s)?css$/, | 41 | test: /\.(s)?css$/, |
@@ -46,17 +45,17 @@ module.exports = function () { | |||
46 | loader: 'css-loader', | 45 | loader: 'css-loader', |
47 | options: { | 46 | options: { |
48 | importLoaders: 1, | 47 | importLoaders: 1, |
49 | } | 48 | }, |
50 | }, | 49 | }, |
51 | 'postcss-loader', | 50 | 'postcss-loader', |
52 | 'sass-loader' | 51 | 'sass-loader', |
53 | ] | 52 | ], |
54 | }, | 53 | }, |
55 | { | 54 | { |
56 | test: /\.(jpg|png|gif|svg|eot|ttf|woff|woff2)$/, | 55 | test: /\.(jpg|png|gif|svg|eot|ttf|woff|woff2)$/, |
57 | use: 'url-loader' | 56 | use: 'url-loader', |
58 | }, | 57 | }, |
59 | ] | 58 | ], |
60 | }, | 59 | }, |
61 | }) | 60 | }); |
62 | }; | 61 | }; |
diff --git a/app/config/webpack/prod.js b/app/config/webpack/prod.js index ef41ab99..44961cc5 100644 --- a/app/config/webpack/prod.js +++ b/app/config/webpack/prod.js | |||
@@ -5,34 +5,34 @@ const ManifestPlugin = require('webpack-manifest-plugin'); | |||
5 | 5 | ||
6 | const commonConfig = require('./common.js'); | 6 | const commonConfig = require('./common.js'); |
7 | 7 | ||
8 | module.exports = function() { | 8 | module.exports = function () { |
9 | return webpackMerge(commonConfig(), { | 9 | return webpackMerge(commonConfig(), { |
10 | output: { | 10 | output: { |
11 | filename: '[name].js' | 11 | filename: '[name].js', |
12 | }, | 12 | }, |
13 | devtool: 'source-map', | 13 | devtool: 'source-map', |
14 | plugins: [ | 14 | plugins: [ |
15 | new webpack.DefinePlugin({ | 15 | new webpack.DefinePlugin({ |
16 | 'process.env': { | 16 | 'process.env': { |
17 | 'NODE_ENV': JSON.stringify('production') | 17 | 'NODE_ENV': JSON.stringify('production'), |
18 | } | 18 | }, |
19 | }), | 19 | }), |
20 | new webpack.optimize.UglifyJsPlugin({ | 20 | new webpack.optimize.UglifyJsPlugin({ |
21 | beautify: false, | 21 | beautify: false, |
22 | mangle: { | 22 | mangle: { |
23 | screw_ie8: true, | 23 | screw_ie8: true, |
24 | keep_fnames: true | 24 | keep_fnames: true, |
25 | }, | 25 | }, |
26 | compress: { | 26 | compress: { |
27 | screw_ie8: true, | 27 | screw_ie8: true, |
28 | warnings: false | 28 | warnings: false, |
29 | }, | 29 | }, |
30 | comments: false | 30 | comments: false, |
31 | }), | 31 | }), |
32 | new ExtractTextPlugin('[name].css'), | 32 | new ExtractTextPlugin('[name].css'), |
33 | new ManifestPlugin({ | 33 | new ManifestPlugin({ |
34 | fileName: 'manifest.json', | 34 | fileName: 'manifest.json', |
35 | }) | 35 | }), |
36 | ], | 36 | ], |
37 | module: { | 37 | module: { |
38 | rules: [ | 38 | rules: [ |
@@ -48,9 +48,9 @@ module.exports = function() { | |||
48 | use: { | 48 | use: { |
49 | loader: 'babel-loader', | 49 | loader: 'babel-loader', |
50 | options: { | 50 | options: { |
51 | presets: ['env'] | 51 | presets: ['env'], |
52 | } | 52 | }, |
53 | } | 53 | }, |
54 | }, | 54 | }, |
55 | { | 55 | { |
56 | test: /\.(s)?css$/, | 56 | test: /\.(s)?css$/, |
@@ -63,17 +63,17 @@ module.exports = function() { | |||
63 | importLoaders: 1, | 63 | importLoaders: 1, |
64 | minimize: { | 64 | minimize: { |
65 | discardComments: { | 65 | discardComments: { |
66 | removeAll: true | 66 | removeAll: true, |
67 | }, | 67 | }, |
68 | core: true, | 68 | core: true, |
69 | minifyFontValues: true | 69 | minifyFontValues: true, |
70 | } | 70 | }, |
71 | } | 71 | }, |
72 | }, | 72 | }, |
73 | 'postcss-loader', | 73 | 'postcss-loader', |
74 | 'sass-loader' | 74 | 'sass-loader', |
75 | ] | 75 | ], |
76 | }) | 76 | }), |
77 | }, | 77 | }, |
78 | { | 78 | { |
79 | test: /\.(jpg|png|gif|svg)$/, | 79 | test: /\.(jpg|png|gif|svg)$/, |
@@ -81,8 +81,8 @@ module.exports = function() { | |||
81 | loader: 'file-loader', | 81 | loader: 'file-loader', |
82 | options: { | 82 | options: { |
83 | name: 'img/[name].[ext]', | 83 | name: 'img/[name].[ext]', |
84 | } | 84 | }, |
85 | } | 85 | }, |
86 | }, | 86 | }, |
87 | { | 87 | { |
88 | test: /\.(eot|ttf|woff|woff2)$/, | 88 | test: /\.(eot|ttf|woff|woff2)$/, |
@@ -90,10 +90,10 @@ module.exports = function() { | |||
90 | loader: 'file-loader', | 90 | loader: 'file-loader', |
91 | options: { | 91 | options: { |
92 | name: 'fonts/[name].[ext]', | 92 | name: 'fonts/[name].[ext]', |
93 | } | 93 | }, |
94 | } | 94 | }, |
95 | } | 95 | }, |
96 | ] | 96 | ], |
97 | }, | 97 | }, |
98 | }) | 98 | }); |
99 | }; | 99 | }; |