Skip to content

Commit 81e16b7

Browse files
committed
fix(build): generate source maps for systemjs bundles (fixes #367)
1 parent 49a780e commit 81e16b7

File tree

5 files changed

+36
-48
lines changed

5 files changed

+36
-48
lines changed

make.js renamed to .config/bundle-system.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ const zlib = require('zlib');
1414
const async = require('async');
1515
const Builder = require('systemjs-builder');
1616

17-
const pkg = require('./package.json');
17+
const pkg = require('../package.json');
1818
const name = pkg.name;
19-
const targetFolder = 'bundles';
20-
19+
const targetFolder = path.resolve('./bundles');
20+
console.log(targetFolder)
2121
async.waterfall([
2222
cleanBundlesFolder,
2323
getSystemJsBundleConfig,
24-
buildSystemJs({mangle: false}),
24+
buildSystemJs({minify: false, sourceMaps: true, mangle: false}),
2525
getSystemJsBundleConfig,
2626
buildSystemJs({minify: true, sourceMaps: true, mangle: false}),
2727
gzipSystemJsBundle
@@ -49,10 +49,11 @@ function getSystemJsBundleConfig(cb) {
4949
};
5050

5151
config.meta = ['angular2', 'rxjs'].reduce((memo, currentValue) => {
52-
memo[`${__dirname}/node_modules/${currentValue}/*`] = {build: false};
52+
memo[path.resolve(`node_modules/${currentValue}/*`)] = {build: false};
5353
return memo;
5454
}, {});
5555
config.meta.moment = {build: false};
56+
console.log(config.meta)
5657
return cb(null, config);
5758
}
5859

.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@ webpack.config.js
2020
*.js.map
2121
!*.d.ts
2222
/components/**/*.ts
23-
/components/**/*.js.map
2423
!/components/**/*.d.ts
2524

clean.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

gh-pages-publish.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

package.json

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,38 @@
33
"version": "1.0.10",
44
"description": "angular2 bootstrap components",
55
"scripts": {
6-
"install:typings": "./node_modules/.bin/typings install",
7-
"compile": "./node_modules/.bin/tsc",
8-
"copy:src": "./node_modules/.bin/cpy ng2-bootstrap.ts \"components/*.ts\" ts --parents",
9-
"clean:dist": "./node_modules/.bin/del bundles coverage demo-build typings",
10-
"publish:gh-pages": "./gh-pages-publish.js",
11-
"prepublish": "npm run install:typings && npm run compile && ./make.js",
12-
"postpublish": "npm run build:prod && npm run publish:gh-pages",
13-
"build:prod": "NODE_ENV=production ./node_modules/.bin/webpack --progress --color",
14-
"build:dev": "./node_modules/.bin/webpack --progress --color",
15-
"serve:dev": "./node_modules/.bin/webpack-dev-server --hot --inline --colors --display-error-details --display-cached",
16-
"serve:prod": "NODE_ENV=production ./node_modules/.bin/webpack-dev-server --hot --inline --colors --display-error-details --display-cached",
17-
"start": "npm run serve:dev",
18-
"pretest": "npm run lint",
6+
"flow.install:typings": "./node_modules/.bin/typings install",
7+
"flow.compile": "npm run flow.install:typings && npm run flow.compile:common && npm run flow.compile:system ",
8+
"flow.compile:common": "./node_modules/.bin/tsc",
9+
"flow.compile:system": "./.config/bundle-system.js",
10+
11+
"flow.copy:src": "./node_modules/.bin/cpy ng2-bootstrap.ts \"components/*.ts\" ts --parents",
12+
"flow.clean": "./node_modules/.bin/del bundles coverage demo-build typings \"components/**/*.+(js|d.ts|js.map)\" dist \"ng2-bootstrap.+(js|d.ts|js.map)\"",
13+
"flow.deploy:gh-pages": "npm run flow.build:prod && ./node_modules/.bin/gh-pages -d demo-build",
14+
15+
"flow.eslint": "./node_modules/.bin/eslint --ignore-path .gitignore --ext js --fix . .config",
16+
"flow.tslint": "./node_modules/.bin/gulp lint",
17+
"flow.lint": "npm run flow.eslint && npm run flow.tslint",
18+
19+
"flow.changelog": "./node_modules/.bin/conventional-changelog -i CHANGELOG.md -s -p angular -v",
20+
"flow.github-release": "conventional-github-releaser -p angular",
21+
22+
"flow.build:prod": "NODE_ENV=production ./node_modules/.bin/webpack --progress --color",
23+
"flow.build:dev": "./node_modules/.bin/webpack --progress --color",
24+
"flow.serve:dev": "./node_modules/.bin/webpack-dev-server --hot --inline --colors --display-error-details --display-cached",
25+
"flow.serve:prod": "NODE_ENV=production ./node_modules/.bin/webpack-dev-server --hot --inline --colors --display-error-details --display-cached",
26+
27+
"prepublish": "npm run flow.clean && npm run flow.compile",
28+
"postpublish": "npm run flow.deploy:gh-pages",
29+
30+
"start": "npm run flow.serve:dev",
31+
32+
"pretest": "npm run flow.lint",
1933
"test": "NODE_ENV=test ./node_modules/.bin/karma start",
20-
"changelog": "./node_modules/.bin/conventional-changelog -i CHANGELOG.md -s -p angular -v",
34+
2135
"preversion": "npm test",
22-
"version": "npm run changelog && git add -A",
23-
"postversion": "git push origin master && git push --tags",
24-
"github-release": "conventional-github-releaser -p angular",
25-
"eslint": "./node_modules/.bin/eslint --ignore-path .gitignore --ext js --fix . .config",
26-
"lint": "npm run eslint && npm run tslint",
27-
"tslint": "./node_modules/.bin/gulp lint"
36+
"version": "npm run flow.changelog && git add -A",
37+
"postversion": "git push origin master && git push --tags"
2838
},
2939
"main": "ng2-bootstrap.js",
3040
"typings": "ng2-bootstrap.d.ts",

0 commit comments

Comments
 (0)