forked from EtienneLeco/vuejs-learning
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
55 lines (53 loc) · 1.52 KB
/
webpack.config.js
File metadata and controls
55 lines (53 loc) · 1.52 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
47
48
49
50
51
52
53
54
55
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require("path");
const ENTRY_DIR = path.resolve(__dirname, "src");
const DIST_DIR = path.resolve(__dirname, "dist");
module.exports = {
devtool: "source-map",
watch: true,
devServer: {
contentBase: __dirname,
compress: true,
port: 9000
},
entry: ["babel-polyfill", ENTRY_DIR + "/app.js"],
output: {
filename: "bundle.js",
path: DIST_DIR,
publicPath: "/dist/"
},
resolve: {
modules: [__dirname, "node_modules"], //allow absolute path in requires (using this directory as root)
alias: {
vue: "vue/dist/vue.js",
}
},
module: {
rules: [{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader"
})
}, {
test: /\.js$/,
use: 'babel-loader',
}, {
test: /\.vue$/,
use: [{
loader: "vue-loader",
options: {
loaders: {
css: ExtractTextPlugin.extract({
use: 'css-loader',
fallback: 'vue-style-loader' // <- this is a dep of vue-loader, so no need to explicitly install if using npm3
})
}
}
}]
}]
},
plugins: [
new ExtractTextPlugin("styles.css"),
]
};