UNPKG

1.71 kBJavaScriptView Raw
1const path = require("path");
2const { VueLoaderPlugin } = require("vue-loader");
3const MiniCssExtractPlugin = require("mini-css-extract-plugin");
4
5module.exports = {
6
7 entry: {
8 "/example/dist/example": [__dirname + "/example/src/example.js", __dirname + "/example/src/example.scss",],
9 "/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.
10 },
11
12 output: {
13 path: path.resolve(__dirname, "./"),
14 filename: "[name].js",
15 library: "VueChartsCSS", // expose `vue-charts-css.min.js` as `window.VueChartsCSS
16 libraryTarget: "umd",
17 },
18
19 resolve: {
20 extensions: ["*", ".js", ".vue", ".json"],
21
22 symlinks: false,
23 },
24
25 module: {
26 rules: [
27 {
28 test: /\.s[ac]ss$/i,
29 use: [
30 "vue-style-loader",
31 {
32 loader: MiniCssExtractPlugin.loader,
33 options: {
34 esModule: false,
35 },
36 },
37 "css-loader",
38 "sass-loader",
39 ],
40 },
41 {
42 test: /\.vue$/,
43 loader: "vue-loader",
44 },
45 {
46 test: /\.js$/,
47 loader: "babel-loader",
48 },
49 ],
50 },
51
52 plugins: [
53 new VueLoaderPlugin(),
54 new MiniCssExtractPlugin({
55 filename: "[name].css",
56 chunkFilename: "[id].[chunkhash]",
57 })
58 ],
59}