Skip to content

Commit

Permalink
Use path in webpack config to assure cross-platform compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
coryhouse committed Sep 15, 2016
1 parent 1abf5d5 commit 2582b61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export default {
// must be first entry to properly set public path
'./src/webpack-public-path',
'webpack-hot-middleware/client?reload=true',
'./src/index'
path.resolve(__dirname, 'src/index.js') // Defining path seems necessary for this to work consistently on Windows machines.
],
target: 'web', // necessary per https://webpack.github.io/docs/testing.html#compile-and-test
output: {
path: `${__dirname}/src`, // Note: Physical files are only output by the production build task `npm run build`.
path: path.resolve(__dirname, 'dist'), // Note: Physical files are only output by the production build task `npm run build`.
publicPath: '/',
filename: 'bundle.js'
},
Expand Down
5 changes: 3 additions & 2 deletions webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import ExtractTextPlugin from 'extract-text-webpack-plugin';
import WebpackMd5Hash from 'webpack-md5-hash';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import autoprefixer from 'autoprefixer';
import path from 'path';

const GLOBALS = {
'process.env.NODE_ENV': JSON.stringify('production'),
Expand All @@ -18,10 +19,10 @@ export default {
debug: true,
devtool: 'source-map', // more info:https://webpack.github.io/docs/build-performance.html#sourcemaps and https://webpack.github.io/docs/configuration.html#devtool
noInfo: true, // set to false to see a list of every file being bundled.
entry: './src/index',
entry: path.resolve(__dirname, '/src/index'),
target: 'web', // necessary per https://webpack.github.io/docs/testing.html#compile-and-test
output: {
path: `${__dirname}/dist`,
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
filename: '[name].[chunkhash].js'
},
Expand Down

0 comments on commit 2582b61

Please sign in to comment.