Skip to content

Commit f5b2225

Browse files
authored
Merge pull request #415 from javascriptdata/JanKaul-esmodule
Jan kaul esmodule
2 parents c9cc17d + 5dcaaa7 commit f5b2225

File tree

5 files changed

+1171
-1229
lines changed

5 files changed

+1171
-1229
lines changed

src/danfojs-browser/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "JavaScript library providing high performance, intuitive, and easy to use data structures for manipulating and processing structured data.",
55
"main": "dist/danfojs-browser/src/index.js",
66
"types": "dist/danfojs-browser/src/index.d.ts",
7+
"module": "lib/bundle-esm.js",
78
"directories": {
89
"test": "tests"
910
},
@@ -99,8 +100,8 @@
99100
"source-map-loader": "^3.0.0",
100101
"ts-loader": "^9.2.6",
101102
"typescript": "^4.4.2",
102-
"webpack": "5.21.2",
103-
"webpack-cli": "4.5.0",
103+
"webpack": "5.69.1",
104+
"webpack-cli": "4.9.2",
104105
"yarn": "^1.22.10"
105106
},
106107
"nyc": {
@@ -110,4 +111,4 @@
110111
]
111112
},
112113
"sideEffects": false
113-
}
114+
}

src/danfojs-browser/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"compilerOptions": {
33
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
4-
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
4+
"module": "es2015", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
5+
"moduleResolution": "node",
56
"lib": ["es6", "dom"], /* Specify library files to be included in the compilation. */
67
"allowJs": true, /* Allow javascript files to be compiled. */
78
"outDir": "./dist", /* Redirect output structure to the directory. */

src/danfojs-browser/webpack.config.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const path = require("path");
33
const webpack = require("webpack");
44

5-
const createConfig = (target) => {
5+
const createConfig = ({ target, filename = "bundle.js", library = "dfd", experiments = undefined }) => {
66
return {
77
mode: "production",
88
devtool: "source-map",
@@ -13,8 +13,8 @@ const createConfig = (target) => {
1313
target: target,
1414
output: {
1515
path: path.resolve(__dirname, "lib"),
16-
filename: `bundle.js`,
17-
library: "dfd"
16+
filename: filename,
17+
library: library
1818
},
1919
plugins: [
2020
// Work around for Buffer is undefined:
@@ -51,8 +51,9 @@ const createConfig = (target) => {
5151
"net": false,
5252
"tls": false
5353
}
54-
}
54+
},
55+
experiments: experiments
5556
};
5657
};
5758

58-
module.exports = [ createConfig("web") ];
59+
module.exports = [ createConfig({ target: "web" }), createConfig({ target: "web", filename: "bundle-esm.js", library: { type: "module" }, experiments: { outputModule: true } }) ];

0 commit comments

Comments
 (0)