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

Updated webpack to v3, fixing errors that resulted from this #5

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
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "Wedding website for myself and my (future) wife",
"main": "index.js",
"scripts": {
"build": "node_modules/.bin/webpack -p --config webpack.config.js",
"watch": "node_modules/.bin/webpack -p --config webpack.config.js --watch",
"build": "node_modules/.bin/webpack --config webpack.config.js",
"watch": "node_modules/.bin/webpack --config webpack.config.js --watch",
"start-dev": "node_modules/.bin/nodemon build/server.js --watch ./build",
"start-prod": "node build/server.js",
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down Expand Up @@ -35,23 +35,23 @@
"dependencies": {
"babel-cli": "^6.11.4",
"babel-core": "^6.13.2",
"babel-loader": "^6.2.10",
"babel-loader": "^6.4.1",
"babel-preset-es2015": "^6.13.2",
"babel-preset-react": "^6.11.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.26.1",
"css-loader": "^0.26.4",
"dotenv": "^2.0.0",
"ejs": "^2.5.5",
"express": "^4.14.0",
"extract-text-webpack-plugin": "^1.0.1",
"extract-text-webpack-plugin": "^2.1.2",
"file-loader": "^0.9.0",
"node-sass": "^4.1.1",
"react": "^15.3.2",
"react-dom": "^15.3.2",
"react-router": "^2.6.1",
"reset-css": "^2.2.0",
"sass-loader": "^4.1.1",
"webpack": "^1.13.3",
"webpack": "^3.0.0",
"x-frame-options": "^1.0.0"
}
}
}
20 changes: 6 additions & 14 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = [
loaders: [
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract("css!sass")
loader: ExtractTextPlugin.extract("css-loader!sass-loader")
},
{
test: /\.(eot|svg|ttf|woff|woff2)/,
Expand All @@ -38,8 +38,9 @@ module.exports = [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}),
new ExtractTextPlugin('../css/[name].css', {
allChunks: true
new ExtractTextPlugin({
allChunks: true,
filename: '../css/[name].css'
}),
new CopyWebpackPlugin([
{from: __dirname + '/src/static/img', to: '../img'}
Expand All @@ -65,20 +66,14 @@ module.exports = [
path.join(__dirname, 'src', 'static'),
path.join(__dirname, 'src', 'views')
],
loader: ['babel-loader'],
query: {
cacheDirectory: 'babel-cache',
presets: ['react', 'es2015']
}
loader: ['babel-loader']
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false },
mangle: true,
Expand Down Expand Up @@ -111,10 +106,7 @@ module.exports = [
path.join(__dirname, 'dist'),
path.join(__dirname, 'src', 'static')
],
loader: ['babel-loader'],
query: {
presets: ['react', 'es2015']
}
loader: ['babel-loader']
}
]
},
Expand Down