Skip to content

Commit

Permalink
fix(build): generate source maps for systemjs bundles (fixes #367)
Browse files Browse the repository at this point in the history
  • Loading branch information
valorkin committed Apr 4, 2016
1 parent 49a780e commit 81e16b7
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 48 deletions.
11 changes: 6 additions & 5 deletions make.js → .config/bundle-system.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ const zlib = require('zlib');
const async = require('async');
const Builder = require('systemjs-builder');

const pkg = require('./package.json');
const pkg = require('../package.json');
const name = pkg.name;
const targetFolder = 'bundles';

const targetFolder = path.resolve('./bundles');
console.log(targetFolder)
async.waterfall([
cleanBundlesFolder,
getSystemJsBundleConfig,
buildSystemJs({mangle: false}),
buildSystemJs({minify: false, sourceMaps: true, mangle: false}),
getSystemJsBundleConfig,
buildSystemJs({minify: true, sourceMaps: true, mangle: false}),
gzipSystemJsBundle
Expand Down Expand Up @@ -49,10 +49,11 @@ function getSystemJsBundleConfig(cb) {
};

config.meta = ['angular2', 'rxjs'].reduce((memo, currentValue) => {
memo[`${__dirname}/node_modules/${currentValue}/*`] = {build: false};
memo[path.resolve(`node_modules/${currentValue}/*`)] = {build: false};
return memo;
}, {});
config.meta.moment = {build: false};
console.log(config.meta)
return cb(null, config);
}

Expand Down
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ webpack.config.js
*.js.map
!*.d.ts
/components/**/*.ts
/components/**/*.js.map
!/components/**/*.d.ts

7 changes: 0 additions & 7 deletions clean.js

This file was deleted.

15 changes: 0 additions & 15 deletions gh-pages-publish.js

This file was deleted.

50 changes: 30 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,38 @@
"version": "1.0.10",
"description": "angular2 bootstrap components",
"scripts": {
"install:typings": "./node_modules/.bin/typings install",
"compile": "./node_modules/.bin/tsc",
"copy:src": "./node_modules/.bin/cpy ng2-bootstrap.ts \"components/*.ts\" ts --parents",
"clean:dist": "./node_modules/.bin/del bundles coverage demo-build typings",
"publish:gh-pages": "./gh-pages-publish.js",
"prepublish": "npm run install:typings && npm run compile && ./make.js",
"postpublish": "npm run build:prod && npm run publish:gh-pages",
"build:prod": "NODE_ENV=production ./node_modules/.bin/webpack --progress --color",
"build:dev": "./node_modules/.bin/webpack --progress --color",
"serve:dev": "./node_modules/.bin/webpack-dev-server --hot --inline --colors --display-error-details --display-cached",
"serve:prod": "NODE_ENV=production ./node_modules/.bin/webpack-dev-server --hot --inline --colors --display-error-details --display-cached",
"start": "npm run serve:dev",
"pretest": "npm run lint",
"flow.install:typings": "./node_modules/.bin/typings install",
"flow.compile": "npm run flow.install:typings && npm run flow.compile:common && npm run flow.compile:system ",
"flow.compile:common": "./node_modules/.bin/tsc",
"flow.compile:system": "./.config/bundle-system.js",

"flow.copy:src": "./node_modules/.bin/cpy ng2-bootstrap.ts \"components/*.ts\" ts --parents",
"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)\"",
"flow.deploy:gh-pages": "npm run flow.build:prod && ./node_modules/.bin/gh-pages -d demo-build",

"flow.eslint": "./node_modules/.bin/eslint --ignore-path .gitignore --ext js --fix . .config",
"flow.tslint": "./node_modules/.bin/gulp lint",
"flow.lint": "npm run flow.eslint && npm run flow.tslint",

"flow.changelog": "./node_modules/.bin/conventional-changelog -i CHANGELOG.md -s -p angular -v",
"flow.github-release": "conventional-github-releaser -p angular",

"flow.build:prod": "NODE_ENV=production ./node_modules/.bin/webpack --progress --color",
"flow.build:dev": "./node_modules/.bin/webpack --progress --color",
"flow.serve:dev": "./node_modules/.bin/webpack-dev-server --hot --inline --colors --display-error-details --display-cached",
"flow.serve:prod": "NODE_ENV=production ./node_modules/.bin/webpack-dev-server --hot --inline --colors --display-error-details --display-cached",

"prepublish": "npm run flow.clean && npm run flow.compile",
"postpublish": "npm run flow.deploy:gh-pages",

"start": "npm run flow.serve:dev",

"pretest": "npm run flow.lint",
"test": "NODE_ENV=test ./node_modules/.bin/karma start",
"changelog": "./node_modules/.bin/conventional-changelog -i CHANGELOG.md -s -p angular -v",

"preversion": "npm test",
"version": "npm run changelog && git add -A",
"postversion": "git push origin master && git push --tags",
"github-release": "conventional-github-releaser -p angular",
"eslint": "./node_modules/.bin/eslint --ignore-path .gitignore --ext js --fix . .config",
"lint": "npm run eslint && npm run tslint",
"tslint": "./node_modules/.bin/gulp lint"
"version": "npm run flow.changelog && git add -A",
"postversion": "git push origin master && git push --tags"
},
"main": "ng2-bootstrap.js",
"typings": "ng2-bootstrap.d.ts",
Expand Down

0 comments on commit 81e16b7

Please sign in to comment.