forked from thanhtunguet/grapesjs-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
43 lines (42 loc) · 885 Bytes
/
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
const WebpackSourcemapSupport = require("webpack-source-map-support");
const WebpackNodeExternals = require("webpack-node-externals");
const tsNameOf = require("ts-nameof");
const {resolve} = require("path");
module.exports = {
mode: process.env.NODE_ENV,
entry: {
"grapesjs-react": resolve("src", "grapesjs-react.tsx"),
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: "awesome-typescript-loader",
options: {
getCustomTransformers: () => ({before: [tsNameOf]}),
},
},
],
},
resolve: {
extensions: [
".ts",
".tsx",
],
modules: [
"node_modules/",
"src/",
],
},
externals: [
new WebpackNodeExternals(),
],
plugins: [
new WebpackSourcemapSupport(),
],
output: {
path: resolve("dist"),
filename: "[name].js",
},
devtool: "source-map",
};