build(): change tsconfig to always use commonjs modules

This commit is contained in:
Jeremy Elbourn
2016-03-16 09:38:21 -07:00
parent ead66f70d2
commit 40d3f0c1a7
3 changed files with 4 additions and 11 deletions
-7
View File
@@ -12,16 +12,9 @@ set -ex
rm -rf ./dist
rm -rf ./deploy
# For packaging for npm only, replace the TypeScript module format to commonjs.
# Creates a tscongig.json.backup with the original file that we'll use to restore after building.
sed -i.backup 's|"module": ".+"|"module": "commonjs"|g' ./src/tsconfig.json
# Perform a build with the modified tsconfig.json.
ng build
# Return tsconfig.json to its original state.
mv -f ./src/tsconfig.json.backup ./src/tsconfig.json
# Inline the css and html into the component ts files.
./node_modules/gulp/bin/gulp.js inline-resources
+3 -3
View File
@@ -23,15 +23,15 @@
System.config({
packages: {
'demo-app': {
format: 'register',
format: 'cjs',
defaultExtension: 'js'
},
'components': {
format: 'register',
format: 'cjs',
defaultExtension: 'js'
},
'core': {
format: 'register',
format: 'cjs',
defaultExtension: 'js'
},
}
+1 -1
View File
@@ -4,7 +4,7 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"mapRoot": "",
"module": "system",
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noImplicitAny": true,