Use webpack to build umd module like upstream
Pirate Praveen
5 years ago
7 | 7 |
, dh-buildinfo
|
8 | 8 |
, nodejs
|
9 | 9 |
, node-tape
|
10 | |
, node-babel-cli
|
|
10 |
, webpack
|
|
11 |
, node-babel-loader
|
|
12 |
, node-babel-plugin-add-module-exports
|
11 | 13 |
, node-babel-preset-es2015
|
12 | |
# , node-babel-loader
|
13 | |
# , node-babel-core
|
14 | |
# , webpack
|
15 | 14 |
, node-d3-path (>= 1)
|
16 | 15 |
, node-d3-polygon
|
17 | |
Standards-Version: 4.1.0
|
|
16 |
Standards-Version: 4.1.3
|
18 | 17 |
Homepage: https://d3js.org/d3-shape/
|
19 | 18 |
Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/node-d3-shape.git
|
20 | 19 |
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-javascript/node-d3-shape.git
|
0 | 0 |
package.json usr/lib/nodejs/d3-shape/
|
1 | |
lib usr/lib/nodejs/d3-shape/
|
|
1 |
build usr/lib/nodejs/d3-shape/
|
debian/patches/use-babel.patch
less
more
0 | |
--- /dev/null
|
1 | |
+++ b/.babelrc
|
2 | |
@@ -0,0 +1,7 @@
|
3 | |
+{
|
4 | |
+ "presets": [
|
5 | |
+ ["es2015", {
|
6 | |
+ "loose": false,
|
7 | |
+ }],
|
8 | |
+ ],
|
9 | |
+}
|
10 | |
--- a/package.json
|
11 | |
+++ b/package.json
|
12 | |
@@ -16,7 +16,7 @@
|
13 | |
"name": "Mike Bostock",
|
14 | |
"url": "http://bost.ocks.org/mike"
|
15 | |
},
|
16 | |
- "main": "build/d3-shape.js",
|
17 | |
+ "main": "lib/index.js",
|
18 | |
"module": "index",
|
19 | |
"jsnext:main": "index",
|
20 | |
"repository": {
|
7 | 7 |
dh $@
|
8 | 8 |
|
9 | 9 |
override_dh_auto_build:
|
10 | |
babeljs src -d lib
|
11 | |
babeljs index.js -d lib
|
12 | |
sed -i 's/.\/src/./' lib/index.js
|
13 | |
# TODO: investigate segfault
|
14 | |
# webpack --config debian/webpack.config.js index.js build/d3-shape.js --target=web --output-library=d3-shape --output-library-target=umd --module-bind 'js=babel-loader'
|
|
10 |
webpack --config debian/webpack.config.js \
|
|
11 |
--output-library=d3 \
|
|
12 |
index.js build/d3-shape.js
|
15 | 13 |
|
16 | 14 |
override_dh_auto_test:
|
17 | 15 |
tape 'test/**/*.js'
|
18 | 16 |
|
19 | 17 |
override_dh_auto_clean:
|
20 | |
rm -rf lib build
|
|
18 |
rm -rf build
|
21 | 19 |
dh_auto_clean
|
0 | 0 |
'use strict';
|
1 | |
|
2 | |
var fs = require('fs');
|
3 | 1 |
var path = require('path');
|
4 | |
var webpack = require('webpack');
|
5 | |
|
6 | 2 |
var config = {
|
7 | |
|
|
3 |
target: 'web',
|
8 | 4 |
resolve: {
|
|
5 |
modules: ['/usr/lib/nodejs', '.'],
|
|
6 |
},
|
|
7 |
resolveLoader: {
|
9 | 8 |
modules: ['/usr/lib/nodejs'],
|
10 | 9 |
},
|
11 | |
|
12 | |
resolveLoader: {
|
13 | |
modules: ['/usr/lib/nodejs'],
|
14 | |
}
|
|
10 |
output: {
|
|
11 |
libraryTarget: 'umd'
|
|
12 |
},
|
|
13 |
module: { rules: [ {test: /\.js$/, loader: 'babel-loader', options: { presets: [ 'es2015' ], plugins: ['add-module-exports'] } }] }
|
15 | 14 |
}
|
16 | |
|
17 | 15 |
module.exports = config;
|