diff --git a/etc/appConfig.js b/etc/appConfig.js index e39cc8c..eb4314d 100644 --- a/etc/appConfig.js +++ b/etc/appConfig.js @@ -1,12 +1,14 @@ var path = require("path"), sourcePath = 'test/app', - sourceRoot = path.resolve(__dirname, '..', sourcePath); + distPath = 'dist', + sourceRoot = path.resolve(__dirname, '..', sourcePath), + distRoot = path.resolve(__dirname, '..', distPath); var appConfig = { srcPath: sourceRoot, genPath: 'src-gen', testPath: 'test/specs', - distPath: 'dist', + distPath: distRoot, templatesPath: 'scripts/templates', specs: '/**/*.spec.ts', testBundle: path.resolve(__dirname, './spec-bundle.js'), diff --git a/etc/helpers.js b/etc/helpers.js index 4a75edf..a626af4 100755 --- a/etc/helpers.js +++ b/etc/helpers.js @@ -113,6 +113,7 @@ function mergeAppConfig(overwrittenConfig) { /*eslint complexity: [error, 22]*/ dist: appConfig.dist || path.resolve(distPath), genPath: genPath, junit: junit, + copy: appConfig.copy, indexFiles: indexFiles, gen: appConfig.gen || path.resolve(genPath), chunks: appConfig.chunks || defaultAppConfig.chunks, diff --git a/etc/webpack.common.js b/etc/webpack.common.js index b2ad540..5bf2a9b 100755 --- a/etc/webpack.common.js +++ b/etc/webpack.common.js @@ -115,10 +115,6 @@ var config = { // resolve https://github.com/holisticon/angular-common/issues/10 exprContextCritical: false, - noParse: [ - /@angular|zone.js/ - ], - /* * An array of automatically applied loaders. * @@ -193,7 +189,7 @@ var config = { // TODO appConfig.srcSASS { test: /\.scss$/, - loaders: ["style", "css", "sass"] + loaders: ['style-loader', 'css-loader', 'sass-loader'] }, /* * to string and css loader support for *.css files diff --git a/etc/webpack.dev.js b/etc/webpack.dev.js index e9f6c81..dd1d075 100755 --- a/etc/webpack.dev.js +++ b/etc/webpack.dev.js @@ -37,20 +37,6 @@ const METADATA = webpackMerge(commonConfig.metadata, { */ module.exports = webpackMerge(commonConfig, { - /** - * Merged metadata from webpack.common.js for index.html - * - * See: (custom attribute) - */ - metadata: METADATA, - - /** - * Switch loaders to debug mode. - * - * See: http://webpack.github.io/docs/configuration.html#debug - */ - // debug: true, - /** * Developer tool to enhance debugging * @@ -134,18 +120,6 @@ module.exports = webpackMerge(commonConfig, { new OpenBrowserPlugin({ url: 'http://localhost:3000' }) ], - /** - * Static analysis linter for TypeScript advanced options configuration - * Description: An extensible linter for the TypeScript language. - * - * See: https://github.com/wbuchwalter/tslint-loader - */ - tslint: { - emitErrors: false, - failOnHint: false, - resourcePath: 'src' - }, - /** * Webpack Development Server configuration * Description: The webpack-dev-server is a little node.js Express server. @@ -162,7 +136,7 @@ module.exports = webpackMerge(commonConfig, { aggregateTimeout: 300, poll: 1000 }, - outputPath: appConfig.dist, + contentBase: appConfig.dist, proxy: appConfig.proxy }, @@ -173,7 +147,7 @@ module.exports = webpackMerge(commonConfig, { * See: https://webpack.github.io/docs/configuration.html#node */ node: { - global: 'window', + global: true, crypto: 'empty', process: true, module: false, diff --git a/test/helpers.spec.js b/test/helpers.spec.js index 0453197..c986482 100644 --- a/test/helpers.spec.js +++ b/test/helpers.spec.js @@ -31,8 +31,10 @@ describe('mergeAppConfig', () => { var config = mergeAppConfig(); expect(config).toBeDefined(); var expectation = getAppConfig(); + delete config['copy']; delete config['junit']; delete expectation['junit']; + delete expectation['copy']; expect(config).toEqualJson(expectation); }); @@ -40,8 +42,10 @@ describe('mergeAppConfig', () => { var config = mergeAppConfig(null); expect(config).toBeDefined(); var expectation = getAppConfig(); + delete config['copy']; delete config['junit']; delete expectation['junit']; + delete expectation['copy']; expect(config).toEqualJson(expectation); }); @@ -49,8 +53,10 @@ describe('mergeAppConfig', () => { var config = mergeAppConfig({}); expect(config).toBeDefined(); var expectation = getAppConfig(); + delete config['copy']; delete config['junit']; delete expectation['junit']; + delete expectation['copy']; expect(config).toEqualJson(expectation); }); @@ -58,6 +64,7 @@ describe('mergeAppConfig', () => { var config = mergeAppConfig({ srcPath: 'src', testPath: 'tests' }); expect(config).toBeDefined(); var expectation = getAppConfig(); + delete config['copy']; delete config['junit']; delete expectation['junit']; expect(config).not.toEqualJson(expectation);