Skip to content

Commit

Permalink
Merge pull request #64 from piyushgupta1/fix/build-issue
Browse files Browse the repository at this point in the history
fix(build): Fix build for native node
  • Loading branch information
Piyush Gupta committed Nov 28, 2018
2 parents e76b017 + 3986bab commit 810a58e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 40 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"statistics",
"json"
],
"main": "dist/dist/data-worker.umd.js",
"main": "dist/data-worker.umd.js",
"typings": "dist/types/data-worker.d.ts",
"files": [
"dist"
Expand All @@ -32,7 +32,8 @@
"test": "jest",
"test:watch": "jest --watch",
"test:prod": "npm run lint && npm run test -- --coverage --no-cache",
"deploy-docs": "ts-node tools/gh-pages-publish",
"docs": "rimraf dist/docs && typedoc --out dist/docs src/data-worker.ts",
"deploy-docs": "npm run docs && ts-node tools/gh-pages-publish",
"report-coverage": "cat ./coverage/lcov.info | coveralls",
"commit": "git-cz",
"semantic-release": "semantic-release",
Expand Down
75 changes: 37 additions & 38 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,40 @@ const libraryName = "data-worker";
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");

module.exports = {
mode: "production",
entry: "./src/data-worker.ts",
module: {
rules: [
{
test: /\.ts?$/,
use: "ts-loader",
exclude: /node_modules/
}
]
},
resolve: {
extensions: [".ts", ".js"]
},
externals: ["d3-array", "d3-collection"],
output: {
filename: pkg.main,
path: path.resolve(__dirname),
library: libraryName,
libraryTarget: "umd",
umdNamedDefine: true
},
optimization: {
minimizer: [
// we specify a custom UglifyJsPlugin here to get source maps in production
new UglifyJsPlugin({
cache: true,
parallel: true,
uglifyOptions: {
compress: true,
ecma: 6,
mangle: true
},
sourceMap: true
})
]
}
};
mode: "production",
entry: "./src/data-worker.ts",
module: {
rules: [{
test: /\.ts?$/,
use: "ts-loader",
exclude: /node_modules/
}]
},
resolve: {
extensions: [".ts", ".js"]
},
externals: ["d3-array", "d3-collection"],
output: {
filename: pkg.main,
path: path.resolve(__dirname),
library: libraryName,
libraryTarget: "umd",
umdNamedDefine: true,
globalObject: 'typeof self !== \'undefined\' ? self : this',
},
optimization: {
minimizer: [
// we specify a custom UglifyJsPlugin here to get source maps in production
new UglifyJsPlugin({
cache: true,
parallel: true,
uglifyOptions: {
compress: true,
ecma: 6,
mangle: true
},
sourceMap: true
})
]
}
};

0 comments on commit 810a58e

Please sign in to comment.