Skip to content

Commit

Permalink
Merge pull request #415 from javascriptdata/JanKaul-esmodule
Browse files Browse the repository at this point in the history
Jan kaul esmodule
  • Loading branch information
risenW authored Mar 8, 2022
2 parents c9cc17d + 5dcaaa7 commit f5b2225
Show file tree
Hide file tree
Showing 5 changed files with 1,171 additions and 1,229 deletions.
7 changes: 4 additions & 3 deletions src/danfojs-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "JavaScript library providing high performance, intuitive, and easy to use data structures for manipulating and processing structured data.",
"main": "dist/danfojs-browser/src/index.js",
"types": "dist/danfojs-browser/src/index.d.ts",
"module": "lib/bundle-esm.js",
"directories": {
"test": "tests"
},
Expand Down Expand Up @@ -99,8 +100,8 @@
"source-map-loader": "^3.0.0",
"ts-loader": "^9.2.6",
"typescript": "^4.4.2",
"webpack": "5.21.2",
"webpack-cli": "4.5.0",
"webpack": "5.69.1",
"webpack-cli": "4.9.2",
"yarn": "^1.22.10"
},
"nyc": {
Expand All @@ -110,4 +111,4 @@
]
},
"sideEffects": false
}
}
3 changes: 2 additions & 1 deletion src/danfojs-browser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"module": "es2015", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"moduleResolution": "node",
"lib": ["es6", "dom"], /* Specify library files to be included in the compilation. */
"allowJs": true, /* Allow javascript files to be compiled. */
"outDir": "./dist", /* Redirect output structure to the directory. */
Expand Down
11 changes: 6 additions & 5 deletions src/danfojs-browser/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const path = require("path");
const webpack = require("webpack");

const createConfig = (target) => {
const createConfig = ({ target, filename = "bundle.js", library = "dfd", experiments = undefined }) => {
return {
mode: "production",
devtool: "source-map",
Expand All @@ -13,8 +13,8 @@ const createConfig = (target) => {
target: target,
output: {
path: path.resolve(__dirname, "lib"),
filename: `bundle.js`,
library: "dfd"
filename: filename,
library: library
},
plugins: [
// Work around for Buffer is undefined:
Expand Down Expand Up @@ -51,8 +51,9 @@ const createConfig = (target) => {
"net": false,
"tls": false
}
}
},
experiments: experiments
};
};

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

0 comments on commit f5b2225

Please sign in to comment.