forked from devowlio/wp-react-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
36 lines (34 loc) · 909 Bytes
/
Copy pathwebpack.config.js
File metadata and controls
36 lines (34 loc) · 909 Bytes
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
"use strict";
const { VueLoaderPlugin } = require("vue-loader");
const path = require("path");
var NODE_ENV = process.env.NODE_ENV || "development";
var dist = path.join(__dirname, "public", NODE_ENV === "production" ? "dist" : "dev");
module.exports = {
mode: NODE_ENV,
entry: {
widget: "./public/src/widget.tsx",
admin: "./public/src/admin.tsx"
},
output: {
path: dist,
filename: "[name].js"
},
module: {
rules: [
{
test: /\.tsx$/,
exclude: /(disposables)/,
use: "babel-loader?cacheDirectory"
},
{
test: /\.vue$/,
use: "vue-loader"
}
]
},
resolve: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
modules: ["node_modules", "public/src"]
},
plugins: [new VueLoaderPlugin()]
};