Skip to content
This repository has been archived by the owner on Jan 18, 2019. It is now read-only.

Commit

Permalink
feat(build): Speed up build
Browse files Browse the repository at this point in the history
  • Loading branch information
hypery2k committed Dec 6, 2016
1 parent ba29692 commit eec2937
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
6 changes: 5 additions & 1 deletion etc/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ webpackConfig.entry = {};
module.exports = function (config) {
'use strict';
config.set({

// see https://github.com/karma-runner/karma-junit-reporter/issues/61
browserNoActivityTimeout: 30000,

// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,

Expand All @@ -34,7 +38,7 @@ module.exports = function (config) {
files: [
'node_modules/angular/angular.js',
'node_modules/angular-mocks/angular-mocks.js',
'**/*.html'
{pattern: '**/*.html', included: false}
],

// list of files / patterns to exclude
Expand Down
24 changes: 22 additions & 2 deletions etc/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ var config = {
*/
extensions: ['', '.ts', '.js', '.jsx', '.json'],

alias: {
angular: path.resolve(appConfig.modulesPath, 'angular')
},

// Make sure root is src
root: appConfig.src,

Expand Down Expand Up @@ -102,6 +106,9 @@ var config = {

noParse: [
/lie.js/,
/angular\.src\.js/,
path.resolve(appConfig.modulesPath, 'angular/angular.js'),
path.resolve(appConfig.modulesPath, 'angular/angular-mocks.js'),
path.resolve(appConfig.modulesPath, 'angular/angular.min.js')
],

Expand Down Expand Up @@ -133,7 +140,10 @@ var config = {
*/
{
test: /\.js$/,
loader: 'source-map-loader'
loader: 'source-map-loader',
exclude: [
/node_modules/
]
}
],

Expand Down Expand Up @@ -162,7 +172,10 @@ var config = {
{
test: /\.js$/,
loaders: ['babel-loader', 'eslint-loader'],
exclude: [/\.ts$/]
exclude: [
/\.ts$/,
/node_modules/
]
},
/*
* Json loader support for *.json files.
Expand Down Expand Up @@ -223,6 +236,13 @@ var config = {
{
test: /\.xml/,
loader: 'raw-loader'
},
/*
* Exports Angular
*/
{
test: /[\/]angular.js$/,
loader: "exports?angular"
}
]

Expand Down
16 changes: 0 additions & 16 deletions etc/webpack.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,6 @@ var config = webpackMerge(commonConfig, {
/node_modules/
]
}

],
/**
* An array of automatically applied loaders.
*
* IMPORTANT: The loaders here are resolved relative to the resource which they are applied to.
* This means they are not resolved relative to the configuration file.
*
* See: http://webpack.github.io/docs/configuration.html#module-loaders
*/
loaders: [
{
test: /\.js$/,
loader: 'babel'
}

]
},

Expand Down

0 comments on commit eec2937

Please sign in to comment.