Skip to content

Commit 03c8140

Browse files
committed
Fixes #193
1 parent 66da953 commit 03c8140

File tree

4 files changed

+1176
-929
lines changed

4 files changed

+1176
-929
lines changed

package.json

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@
33
"version": "6.1.0",
44
"description": "A React Tiling Window Manager",
55
"license": "Apache-2.0",
6-
"main": "lib/index.js",
6+
"main": "./cjs/index.js",
7+
"module": "./esm/index.js",
8+
"typings": "index.d.ts",
9+
"exports": {
10+
"import": "./esm/index.js",
11+
"require": "./cjs/index.js",
12+
"default": "./cjs/index.js"
13+
},
714
"style": "lib/react-mosaic.css",
8-
"type": "commonjs",
9-
"typings": "lib/index.d.ts",
15+
"files": [
16+
"/lib",
17+
"/index.d.ts"
18+
],
1019
"repository": {
1120
"type": "git",
1221
"url": "https://github.com/nomcopter/react-mosaic.git"
@@ -25,10 +34,12 @@
2534
],
2635
"scripts": {
2736
"build": "npm-run-all clean -lp build:**",
28-
"build:ts": "tsc -p tsconfig-build.json",
2937
"build:less": "lessc --autoprefix=defaults styles/index.less react-mosaic-component.css",
30-
"bundle": "rm -rf docs/ && webpack --config webpack/bundle.ts",
31-
"clean": "rm -rf lib/",
38+
"build:esm": "tsc --project tsconfig-build.json --declaration false --rootDir src --module esnext --outDir ./lib/esm",
39+
"build:cjs": "tsc --project tsconfig-build.json --declaration false --rootDir src --module commonjs --outDir ./lib/cjs",
40+
"build:declaration": "tsc --project tsconfig-build.json --rootDir src --outDir ./lib --emitDeclarationOnly",
41+
"bundle": "shx rm -rf docs/ && webpack --config webpack/bundle.ts",
42+
"clean": "shx rm -rf lib/",
3243
"start": "webpack-dev-server --config webpack/hot.ts",
3344
"prettier:run": "prettier 'styles/*.less' '*.md' '{,.}*.yml' '.circleci/*.yml'",
3445
"test": "npm-run-all build -lp test:**",
@@ -42,6 +53,7 @@
4253
},
4354
"dependencies": {
4455
"classnames": "^2.3.2",
56+
"dnd-core": "16.0.1",
4557
"immutability-helper": "^3.1.1",
4658
"lodash": "^4.17.21",
4759
"prop-types": "^15.8.1",
@@ -68,7 +80,6 @@
6880
"@types/webpack": "^5.28.0",
6981
"chai": "^4.3.6",
7082
"css-loader": "^6.7.3",
71-
"dnd-core": "16.0.1",
7283
"html-loader": "^4.2.0",
7384
"html-webpack-plugin": "^5.5.0",
7485
"jsdom": "^15.2.1",
@@ -85,6 +96,7 @@
8596
"react-dom": "^18.2.0",
8697
"react-refresh": "^0.14.0",
8798
"source-map-loader": "^4.0.1",
99+
"shx": "0.3.4",
88100
"style-loader": "^3.3.1",
89101
"ts-loader": "^9.4.2",
90102
"ts-node": "^10.9.1",

tsconfig-build.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"compilerOptions": {
3-
"noEmit": false,
4-
"outDir": "lib",
5-
"rootDir": "src"
3+
"declaration": true,
64
},
5+
"include": ["**/*.ts", "**/*.tsx"],
76
"exclude": [
87
"demo",
98
"docs",

tsconfig.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
{
22
"compileOnSave": false,
33
"compilerOptions": {
4+
"rootDir": ".",
45
"declaration": true,
56
"esModuleInterop": true,
67
"experimentalDecorators": true,
78
"forceConsistentCasingInFileNames": true,
89
"jsx": "react",
9-
"lib": ["dom", "es5", "scripthost", "es2015.promise"],
10+
"lib": ["dom", "es2017", "scripthost", "es2015.promise"],
1011
"moduleResolution": "node",
11-
"module": "commonjs",
12-
"noEmit": true,
12+
"module": "ESNext",
1313
"noFallthroughCasesInSwitch": true,
1414
"noImplicitReturns": true,
1515
"noUnusedLocals": true,
1616
"noUnusedParameters": true,
17-
"target": "es5",
17+
"target": "ES2015",
1818
"skipLibCheck": true,
19+
"baseUrl": ".",
1920
"sourceMap": true,
2021
"strict": true
2122
},

0 commit comments

Comments
 (0)