-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.js
59 lines (52 loc) · 1.61 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
49
50
51
52
53
54
55
56
57
58
59
const path = require("path");
const { VueLoaderPlugin } = require("vue-loader");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
entry: {
"/example/dist/example": [__dirname + "/example/src/example.js", __dirname + "/example/src/example.scss",],
"/dist/vue-charts-css.min": __dirname + "/src/index.js", // If you provide an array as the entry point, only the last one in the array will be exposed.
},
output: {
path: path.resolve(__dirname, "./"),
filename: "[name].js",
library: "VueChartsCSS", // expose `vue-charts-css.min.js` as `window.VueChartsCSS
libraryTarget: "umd",
},
resolve: {
extensions: ["*", ".js", ".vue", ".json"],
symlinks: false,
},
module: {
rules: [
{
test: /\.s[ac]ss$/i,
use: [
"vue-style-loader",
{
loader: MiniCssExtractPlugin.loader,
options: {
esModule: false,
},
},
"css-loader",
"sass-loader",
],
},
{
test: /\.vue$/,
loader: "vue-loader",
},
{
test: /\.js$/,
loader: "babel-loader",
},
],
},
plugins: [
new VueLoaderPlugin(),
new MiniCssExtractPlugin({
filename: "[name].css",
chunkFilename: "[id].[chunkhash]",
})
],
}