kamrify commited on
Commit
ebda3a6
·
1 Parent(s): 1809cfd

Add dev and production webpack config

Browse files
webpack.dev.config.js → webpack.config.dev.js RENAMED
@@ -50,5 +50,5 @@ module.exports = {
50
  stats: {
51
  colors: true,
52
  },
53
- devtool: 'source-map',
54
  };
 
50
  stats: {
51
  colors: true,
52
  },
53
+ devtool: 'cheap-module-eval-source-map',
54
  };
webpack.config.prod.js ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const path = require('path');
2
+ const ExtractTextPlugin = require('extract-text-webpack-plugin');
3
+
4
+ module.exports = {
5
+ mode: 'production',
6
+ entry: [
7
+ './assets/scripts/src/sholo.js',
8
+ './assets/styles/scss/sholo.scss',
9
+ ],
10
+ output: {
11
+ path: path.join(__dirname, '/assets'),
12
+ publicPath: '/assets/',
13
+ filename: 'scripts/dist/sholo.min.js',
14
+ libraryTarget: 'umd',
15
+ library: 'Sholo',
16
+ },
17
+ module: {
18
+ rules: [
19
+ {
20
+ test: /\.js$/,
21
+ exclude: /node_modules/,
22
+ loader: 'eslint-loader',
23
+ enforce: 'pre',
24
+ options: {
25
+ failOnWarning: false,
26
+ failOnError: true,
27
+ },
28
+ },
29
+ {
30
+ test: /\.js$/,
31
+ exclude: /node_modules/,
32
+ loader: 'babel-loader',
33
+ options: {
34
+ presets: ['env'],
35
+ },
36
+ },
37
+ {
38
+ test: /.scss$/,
39
+ loader: ExtractTextPlugin.extract([
40
+ {
41
+ loader: 'css-loader',
42
+ options: { minimize: true },
43
+ },
44
+ 'sass-loader',
45
+ ]),
46
+ },
47
+ ],
48
+ },
49
+ plugins: [
50
+ new ExtractTextPlugin({
51
+ filename: 'styles/css/sholo.min.css',
52
+ allChunks: true,
53
+ }),
54
+ ],
55
+ stats: {
56
+ colors: true,
57
+ },
58
+ devtool: 'cheap-module-source-map',
59
+ };