Created
December 20, 2017 09:09
-
-
Save chason/f215f0e89f14936b9a3a423b0a35a9eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require('webpack'); | |
const merge = require('webpack-merge'); | |
const common = require('./webpack.common.js'); | |
const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); | |
module.exports = merge(common, { | |
devtool: 'source-map', | |
plugins: [ | |
new UglifyJSPlugin({ | |
sourceMap: true | |
}), | |
new webpack.DefinePlugin({ | |
'process.env.NODE_ENV': JSON.stringify('production') | |
}) | |
] | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "rwp-web", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"build": "webpack --config webpack.prod.js", | |
"start": "webpack-dev-server --open --config webpack.dev.js" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"devDependencies": { | |
"aos": "^2.2.0", | |
"babel-cli": "^6.26.0", | |
"clean-webpack-plugin": "^0.1.17", | |
"css-loader": "^0.28.7", | |
"file-loader": "^1.1.5", | |
"google-fonts-webpack-plugin": "^0.4.3", | |
"google-maps": "^3.2.1", | |
"html-webpack-plugin": "^2.30.1", | |
"jquery": "^3.2.1", | |
"jquery-scrollify": "^1.0.17", | |
"jquery.easing": "^1.4.1", | |
"node-sass": "^4.7.2", | |
"normalize.css": "^7.0.0", | |
"postcss": "^6.0.14", | |
"postcss-animations": "^0.3.0", | |
"postcss-font-magician": "^2.1.0", | |
"postcss-loader": "^2.0.9", | |
"precss": "^2.0.0", | |
"sass-loader": "^6.0.6", | |
"style-loader": "^0.19.0", | |
"uglifyjs-webpack-plugin": "^1.1.2", | |
"webpack": "^3.10.0", | |
"webpack-dev-server": "^2.9.5", | |
"webpack-merge": "^4.1.1" | |
}, | |
"dependencies": { | |
"babel-core": "^6.26.0", | |
"babel-loader": "^7.1.2", | |
"babel-preset-env": "^1.6.1" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const CleanWebpackPlugin = require('clean-webpack-plugin'); | |
module.exports = { | |
entry: { | |
app: './src/index.js' | |
}, | |
plugins: [ | |
new HtmlWebpackPlugin({ | |
title: 'Route One Power' | |
}), | |
], | |
module: { | |
rules: [ | |
{ | |
test: /\.css$/, | |
use: [ | |
'style-loader', | |
{ | |
loader: 'css-loader', | |
options: { | |
importLoaders: 1 | |
} | |
}, | |
'postcss-loader', | |
] | |
}, | |
{ | |
test: /\.scss$/, | |
use: [ | |
'style-loader', | |
{ | |
loader: 'css-loader', | |
options: { | |
importLoaders: 1 | |
} | |
}, | |
'postcss-loader', | |
'sass-loader' | |
] | |
}, | |
{ | |
test: /\.js$/, | |
exclude: /(node_modules|bower_components)/, | |
use: [ | |
{ | |
loader: 'babel-loader', | |
options: { | |
presets: ['babel-preset-env'], | |
} | |
} | |
] | |
}, | |
{ | |
test: /\.(png|svg|jpg|gif)$/, | |
use: [ | |
'file-loader' | |
] | |
}, | |
{ | |
test: /\.(woff|woff2|eot|ttf|otf)$/, | |
use: [ | |
'file-loader' | |
] | |
}, | |
] | |
}, | |
output: { | |
filename: '[name].bundle.js', | |
path: path.resolve(__dirname + 'dist/'), | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment