-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.common.js
36 lines (35 loc) · 1.07 KB
/
webpack.common.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
const path = require("path")
const CleanWebpackPlugin = require("clean-webpack-plugin")
const VueLoaderPlugin = require("vue-loader/lib/plugin")
module.exports = {
entry: ["@babel/polyfill", path.resolve("src/front/app.js")],
output: {
filename: "[name].bundle.js",
path: path.resolve(__dirname, "dist"),
publicPath: "dist/",
pathinfo: false
},
resolve: {
modules: [path.join(__dirname, "src"), "node_modules"]
},
plugins: [new CleanWebpackPlugin(), new VueLoaderPlugin()],
module: {
rules: [
{ test: /\.vue$/, loader: "vue-loader" },
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" },
{ test: /\.css$/, use: ["vue-style-loader", "css-loader"] },
{
test: /\.scss$/,
use: ["vue-style-loader", "css-loader", "sass-loader"]
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: "url-loader?limit=100000&name=../img/[name].[ext]"
},
{
test: /\.(woff(2)?|eot|otf|ttf|svg)(\?[a-z0-9=\.]+)?$/,
loader: "file-loader?name=../fonts/[name].[ext]"
}
]
}
}