diff options
author | Pirate Praveen <praveen@debian.org> | 2018-01-09 23:03:26 +0530 |
---|---|---|
committer | Pirate Praveen <praveen@debian.org> | 2018-01-09 23:03:26 +0530 |
commit | 50f3df114905875641f2dfc0d83674c1c9fbe5da (patch) | |
tree | 5418ec439389a0f57e74c393a451df063d3537f5 | |
parent | 6d4ce5212a4da957fdbc873061c401e514f8c48e (diff) |
Use webpack to build umd module like upstream
-rw-r--r-- | debian/control | 6 | ||||
-rw-r--r-- | debian/install | 2 | ||||
-rw-r--r-- | debian/patches/series | 1 | ||||
-rw-r--r-- | debian/patches/use-babel.patch | 36 | ||||
-rwxr-xr-x | debian/rules | 8 | ||||
-rw-r--r-- | debian/webpack.config.js | 16 |
6 files changed, 25 insertions, 44 deletions
diff --git a/debian/control b/debian/control index cb3b6e5..50bc118 100644 --- a/debian/control +++ b/debian/control @@ -8,10 +8,12 @@ Build-Depends: , dh-buildinfo , nodejs , node-tape - , node-babel-cli + , webpack + , node-babel-loader + , node-babel-plugin-add-module-exports , node-babel-preset-es2015 , node-d3-array -Standards-Version: 4.1.0 +Standards-Version: 4.1.3 Homepage: https://d3js.org/d3-collection/ Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/node-d3-collection.git Vcs-Browser: https://anonscm.debian.org/cgit/pkg-javascript/node-d3-collection.git diff --git a/debian/install b/debian/install index a5d8512..86be9d4 100644 --- a/debian/install +++ b/debian/install @@ -1,2 +1,2 @@ package.json usr/lib/nodejs/d3-collection/ -lib usr/lib/nodejs/d3-collection/ +build usr/lib/nodejs/d3-collection/ diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index 7937310..0000000 --- a/debian/patches/series +++ /dev/null @@ -1 +0,0 @@ -use-babel.patch diff --git a/debian/patches/use-babel.patch b/debian/patches/use-babel.patch deleted file mode 100644 index f9717ea..0000000 --- a/debian/patches/use-babel.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- /dev/null -+++ b/.babelrc -@@ -0,0 +1,22 @@ -+{ -+ "presets": [ -+ ["es2015", { -+ "loose": false, -+ }], -+ ], -+ "plugins": [ -+ ], -+ "env": { -+ "watch": { -+ "presets": [ -+ ["es2015", { -+ "loose": true -+ }], -+ "stage-0" -+ ] -+ }, -+ "test": { -+ "plugins": ["istanbul"] -+ } -+ } -+} ---- a/package.json -+++ b/package.json -@@ -18,7 +18,7 @@ - "name": "Mike Bostock", - "url": "http://bost.ocks.org/mike" - }, -- "main": "build/d3-collection.js", -+ "main": "lib/index.js", - "module": "index", - "jsnext:main": "index", - "repository": { diff --git a/debian/rules b/debian/rules index 9eda1f7..bfa1a49 100755 --- a/debian/rules +++ b/debian/rules @@ -8,14 +8,14 @@ dh $@ override_dh_auto_build: - babeljs src -d lib - babeljs index.js -d lib - sed -i 's/.\/src/./' lib/index.js + webpack --config debian/webpack.config.js \ + --output-library=d3 \ + index.js build/d3-collection.js override_dh_auto_test: tape 'test/**/*-test.js' override_dh_auto_clean: dh_auto_clean - rm -rf lib + rm -rf build diff --git a/debian/webpack.config.js b/debian/webpack.config.js new file mode 100644 index 0000000..f9cb59f --- /dev/null +++ b/debian/webpack.config.js @@ -0,0 +1,16 @@ +'use strict'; +var path = require('path'); +var config = { + target: 'web', + resolve: { + modules: ['/usr/lib/nodejs', '.'], + }, + resolveLoader: { + modules: ['/usr/lib/nodejs'], + }, + output: { + libraryTarget: 'umd' + }, + module: { rules: [ {test: /\.js$/, loader: 'babel-loader', options: { presets: [ 'es2015' ], plugins: ['add-module-exports'] } }] } +} +module.exports = config; |