-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.dev.babel.js
73 lines (68 loc) · 1.68 KB
/
webpack.config.dev.babel.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
"use strict"
import BrowserSyncPlugin from "browser-sync-webpack-plugin"
import CopyWebpackPlugin from "copy-webpack-plugin"
import ExtractTextPlugin from "extract-text-webpack-plugin"
import HtmlWebpackPlugin from "html-webpack-plugin"
import autoprefixer from "autoprefixer"
import path from "path"
import webpack from "webpack"
let INPUT = `/src/`
let OUTPUT = `/dev/`
let plugins = [
new HtmlWebpackPlugin({
filename: __dirname + `${OUTPUT}index.html`,
template: __dirname + `/${INPUT}html/index.ejs`
}),
new CopyWebpackPlugin([{
from: __dirname + `/${INPUT}img/`,
to: __dirname + `/${OUTPUT}assets/img/`
}]),
new CopyWebpackPlugin([{
from: __dirname + `/${INPUT}model/`,
to: __dirname + `/${OUTPUT}assets/model/`
}]),
new ExtractTextPlugin({
filename: 'css/bundle.css',
disable: false,
allChunks: true
})
]
const config = {
entry: [
path.resolve(__dirname, `./${INPUT}js/app.js`),
path.resolve(__dirname, `./${INPUT}scss/app.scss`),
],
output: {
path: path.resolve(__dirname, `./${OUTPUT}assets/`),
filename: 'js/bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.(scss|css)$/,
loader: ExtractTextPlugin.extract({
use: [{
loader: 'css-loader',
options: {
url: false,
modules: false,
sourceMap: false,
minimize: false
}
}, {
loader: 'postcss-loader'
},{
loader: 'sass-loader'
}]
})
}
]
},
plugins: plugins
};
module.exports = config