Skip to content

Commit a08a493

Browse files
committed
chore: add ESM webpack
1 parent 6f5c900 commit a08a493

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

packages/layout/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"dev": "webpack --config webpack.dev.config.js --mode development",
6161
"build": "npm run clean && run-p build:*",
6262
"ci": "npm run build && npm run test",
63-
"build:esm": "tsc",
63+
"build:esm": "webpack --config webpack.esm.config.js --mode production",
6464
"build:umd": "webpack --config webpack.config.js --mode production",
6565
"publish:alpha": "npm publish --tag alpha",
6666
"test": "jest",

packages/layout/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"resolveJsonModule": true,
1616
"esModuleInterop": true,
1717
"lib": ["esnext", "dom"],
18+
"types": [],
1819
"experimentalDecorators": false /* Enables experimental support for ES7 decorators. */,
1920
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
2021
"downlevelIteration": true,
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const path = require("path");
2+
3+
module.exports = {
4+
entry: "./src/bundle-entry.ts",
5+
experiments: {
6+
outputModule: true,
7+
},
8+
output: {
9+
filename: "index.js",
10+
publicPath: "",
11+
path: path.resolve(__dirname, "lib"),
12+
library: {
13+
type: "module",
14+
},
15+
clean: true,
16+
},
17+
resolve: {
18+
extensions: [".ts", ".js"],
19+
},
20+
module: {
21+
rules: [
22+
{
23+
test: /\.tsx?$/,
24+
use: "ts-loader",
25+
exclude: /node_modules/,
26+
},
27+
],
28+
},
29+
devtool: "source-map",
30+
};

0 commit comments

Comments
 (0)