Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

Upgrade to Babel 6 #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
39 changes: 20 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,36 @@
"homepage": "https://github.com/Foxandxss/angular-webpack-workflow",
"dependencies": {
"angular": "^1.3.16",
"angular-ui-router": "^0.2.15",
"autoprefixer-core": "^5.2.0",
"babel-core": "^5.5.8",
"babel-loader": "^5.1.4",
"babel-runtime": "^5.5.8",
"angular-ui-router": "^0.3.1",
"autoprefixer": "^6.0.1",
"babel-core": "^6.17.0",
"babel-loader": "^6.2.5",
"babel-runtime": "^6.11.6",
"bootstrap": "^3.3.5",
"css-loader": "^0.14.5",
"extract-text-webpack-plugin": "^0.8.2",
"file-loader": "^0.8.4",
"html-webpack-plugin": "^1.5.2",
"node-libs-browser": "^0.5.2",
"postcss-loader": "^0.4.4",
"css-loader": "^0.25.0",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.9.0",
"html-webpack-plugin": "^2.22.0",
"node-libs-browser": "^1.0.0",
"postcss-loader": "^1.0.0",
"raw-loader": "^0.5.1",
"style-loader": "^0.12.3",
"style-loader": "^0.13.1",
"webpack": "^1.9.11",
"webpack-dev-server": "^1.9.0"
},
"devDependencies": {
"angular-mocks": "^1.4.1",
"isparta-instrumenter-loader": "^0.2.1",
"babel-preset-es2015": "^6.16.0",
"isparta-instrumenter-loader": "^1.0.1",
"jasmine-core": "^2.3.4",
"karma": "^0.13.9",
"karma-coverage": "^0.4.2",
"karma-jasmine": "^0.3.5",
"karma-phantomjs-launcher": "^0.2.0",
"karma": "^1.3.0",
"karma-coverage": "^1.1.1",
"karma-jasmine": "^1.0.2",
"karma-phantomjs-launcher": "^1.0.2",
"karma-sourcemap-loader": "^0.3.5",
"karma-spec-reporter": "0.0.19",
"karma-spec-reporter": "0.0.26",
"karma-webpack": "^1.5.1",
"null-loader": "^0.1.1",
"phantomjs": "^1.9.17"
"phantomjs": "^2.1.7"
}
}
29 changes: 17 additions & 12 deletions webpack.make.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Modules
var webpack = require('webpack');
var autoprefixer = require('autoprefixer-core');
var autoprefixer = require('autoprefixer');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');

Expand All @@ -29,11 +29,11 @@ module.exports = function makeWebpackConfig (options) {
* Karma will set this when it's a test build
*/
if (TEST) {
config.entry = {}
config.entry = {};
} else {
config.entry = {
app: './src/app.js'
}
};
}

/**
Expand All @@ -43,7 +43,7 @@ module.exports = function makeWebpackConfig (options) {
* Karma will handle setting it up for you when it's a test build
*/
if (TEST) {
config.output = {}
config.output = {};
} else {
config.output = {
// Absolute output directory
Expand All @@ -60,7 +60,7 @@ module.exports = function makeWebpackConfig (options) {
// Filename for non-entry points
// Only adds hash in build mode
chunkFilename: BUILD ? '[name].[hash].js' : '[name].bundle.js'
}
};
}

/**
Expand Down Expand Up @@ -92,7 +92,10 @@ module.exports = function makeWebpackConfig (options) {
// Transpile .js files using babel-loader
// Compiles ES6 and ES7 into ES5 code
test: /\.js$/,
loader: 'babel?optional=runtime',
loader: 'babel',
query: {
presets: ['es2015']
},
exclude: /node_modules/
}, {
// ASSET LOADER
Expand Down Expand Up @@ -124,7 +127,7 @@ module.exports = function makeWebpackConfig (options) {
/\.test\.js$/
],
loader: 'isparta-instrumenter'
})
});
}

// CSS LOADER
Expand All @@ -147,7 +150,7 @@ module.exports = function makeWebpackConfig (options) {
if (TEST) {
// Reference: https://github.com/webpack/null-loader
// Return an empty module
cssLoader.loader = 'null'
cssLoader.loader = 'null';
}

// Add cssLoader to the loader list
Expand Down Expand Up @@ -186,9 +189,11 @@ module.exports = function makeWebpackConfig (options) {
new HtmlWebpackPlugin({
template: './src/index.html',
inject: 'body',
minify: BUILD
minify: {
removeAttributeQuotes: true
}
})
)
);
}

// Add build specific plugins
Expand All @@ -205,7 +210,7 @@ module.exports = function makeWebpackConfig (options) {
// Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin
// Minify all javascript, switch loaders to minimizing mode
new webpack.optimize.UglifyJsPlugin()
)
);
}

/**
Expand All @@ -224,4 +229,4 @@ module.exports = function makeWebpackConfig (options) {
};

return config;
};
};