From bdb01abaca40b00ec9d2b00032bef6f130206478 Mon Sep 17 00:00:00 2001 From: SystemBug Date: Mon, 4 Jan 2016 19:46:33 -0800 Subject: [PATCH 1/2] Fix path issue on windows __dirname + "/app" won't work well on windows. use path.join to make sure the path friendly with window. --- webpack.make.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/webpack.make.js b/webpack.make.js index 8001ea4..ce4211a 100644 --- a/webpack.make.js +++ b/webpack.make.js @@ -1,8 +1,9 @@ // Modules -var webpack = require('webpack') -var autoprefixer = require('autoprefixer') -var HtmlWebpackPlugin = require('html-webpack-plugin') -var ExtractTextPlugin = require('extract-text-webpack-plugin') +var webpack = require('webpack'); +var autoprefixer = require('autoprefixer'); +var HtmlWebpackPlugin = require('html-webpack-plugin'); +var ExtractTextPlugin = require('extract-text-webpack-plugin'); +var path = require('path'); /** * Make webpack config @@ -57,7 +58,7 @@ module.exports = function makeWebpackConfig (options) { } else { config.output = { // Absolute output directory - path: __dirname + '/public', + path: path.join(__dirname, 'public'), // Output path from the view of the page // Uses webpack-dev-server in development @@ -177,7 +178,7 @@ module.exports = function makeWebpackConfig (options) { // Allow loading css through js and getting the className var localCssLoader = { test: /\.css$/, - include: __dirname + '/app', + include: path.join(__dirname, 'app'), // Reference: https://github.com/webpack/extract-text-webpack-plugin // Extract css files in production builds loader: ExtractTextPlugin.extract( @@ -195,7 +196,7 @@ module.exports = function makeWebpackConfig (options) { // The same as localCssLoader, but imports are globals var globalCssLoader = { test: /\.css$/, - include: __dirname + '/node_modules', + include: path.join(__dirname, 'node_modules'), loader: ExtractTextPlugin.extract('style', 'css?sourceMap!postcss') } From 586d9325d0a5416d39e45e6cd59f4df331884a84 Mon Sep 17 00:00:00 2001 From: SystemBug Date: Mon, 4 Jan 2016 19:57:49 -0800 Subject: [PATCH 2/2] remove comman per lint requirement --- webpack.make.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webpack.make.js b/webpack.make.js index ce4211a..06ca939 100644 --- a/webpack.make.js +++ b/webpack.make.js @@ -1,9 +1,9 @@ // Modules -var webpack = require('webpack'); -var autoprefixer = require('autoprefixer'); -var HtmlWebpackPlugin = require('html-webpack-plugin'); -var ExtractTextPlugin = require('extract-text-webpack-plugin'); -var path = require('path'); +var webpack = require('webpack') +var autoprefixer = require('autoprefixer') +var HtmlWebpackPlugin = require('html-webpack-plugin') +var ExtractTextPlugin = require('extract-text-webpack-plugin') +var path = require('path') /** * Make webpack config