diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..a0765e1 --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015"] +} diff --git a/package.json b/package.json index 7dcc120..a80e106 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/webpack.make.js b/webpack.make.js index 20b3a40..a822e61 100644 --- a/webpack.make.js +++ b/webpack.make.js @@ -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'); @@ -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' - } + }; } /** @@ -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 @@ -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' - } + }; } /** @@ -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 @@ -124,7 +127,7 @@ module.exports = function makeWebpackConfig (options) { /\.test\.js$/ ], loader: 'isparta-instrumenter' - }) + }); } // CSS LOADER @@ -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 @@ -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 @@ -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() - ) + ); } /** @@ -224,4 +229,4 @@ module.exports = function makeWebpackConfig (options) { }; return config; -}; \ No newline at end of file +};