-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
46 lines (43 loc) · 1.11 KB
/
Copy pathwebpack.config.js
File metadata and controls
46 lines (43 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
./webpack.config.js
*/
const path = require('path');
const webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: './src/index.jsx',
output: {
path: path.resolve('dist'),
filename: 'index_bundle.js'
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: [/ node_modules/],
loader: 'babel-loader',
// query: {
// presets: ['es2015', 'react']
// }
},
{ //CSS loader
test: /\.css$/,
use: ExtractTextPlugin.extract({use: ["css-loader"]})
},
{ //JPG loader
test: /\.jpg$/, use: "url-loader?limit=13000"
},
{ //PNG loader
test: /\.png$/, use: "url-loader?limit=13000"
},
{ //GIF loader
test: /\.gif$/, use: "url-loader?limit=13000"
},
{ //Font loader
test: /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/, use: "file-loader"
}]
},
plugins: [
new ExtractTextPlugin('/css/main.css')
]
};