forked from ovidium19/lincoln-resources
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
48 lines (48 loc) · 1.52 KB
/
webpack.config.js
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
47
48
const path = require('path');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
context: path.resolve('public'),
entry: {
'bundle.js': "./app.js",
'all-default.css': "./build-default.js",
'all-ocean.css': "./build-ocean.js",
'all-robust.css':"./build-robust.js"
},
output:{
path: path.resolve(__dirname,"dist"),
filename: "./[name]"
},
module:{
rules:[
{test: /\.js/,exclude:[/node_modules/,/angular/,/bootstrap/], use:'babel-loader'},
{test: /\.html/, use: 'raw-loader', exclude: [/node_modules/,/angular/,/bootstrap/]},
{test: /\.json$/,use:'json-loader'},
{
test:/all-.*.less$/,
exclude:[/node_modules/,/bootstrap/],
use:ExtractTextPlugin.extract({
fallback: "style-loader",
use: [{ loader: 'css-loader', options: { importLoaders: 2 } },
"autoprefixer-loader",
"less-loader",
]
})
},
{
test: /\.(jpe?g|png|gif)$/,
use: {
loader: 'url-loader',
options: {
limit: 8192,
name: "./images/[name].[ext]"
}
}
}
]
},
plugins: [
new ExtractTextPlugin({
filename: "./css/[name]"
})
]
};