From 40d3f0c1a7d05a3f18050b2c2758504aea6f0423 Mon Sep 17 00:00:00 2001 From: Jeremy Elbourn Date: Wed, 16 Mar 2016 09:38:21 -0700 Subject: [PATCH] build(): change tsconfig to always use commonjs modules --- scripts/release/stage-release.sh | 7 ------- src/index.html | 6 +++--- src/tsconfig.json | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/scripts/release/stage-release.sh b/scripts/release/stage-release.sh index d585b5d0d75..b90e54ef957 100755 --- a/scripts/release/stage-release.sh +++ b/scripts/release/stage-release.sh @@ -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 diff --git a/src/index.html b/src/index.html index ccfef165579..902fb79d8eb 100644 --- a/src/index.html +++ b/src/index.html @@ -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' }, } diff --git a/src/tsconfig.json b/src/tsconfig.json index 8b94d5348a6..9633bb74b26 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -4,7 +4,7 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "mapRoot": "", - "module": "system", + "module": "commonjs", "moduleResolution": "node", "noEmitOnError": true, "noImplicitAny": true,