Skip to content
Closed
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
3 changes: 3 additions & 0 deletions config/paths.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,6 +38,7 @@ if (isInCreateReactAppSource) {
appHtml: resolveOwn('../template/index.html'),
appFavicon: resolveOwn('../template/favicon.ico'),
appPackageJson: resolveOwn('../package.json'),
appStatic: resolveOwn('../template/static'),
appSrc: resolveOwn('../template/src'),
appNodeModules: resolveOwn('../node_modules'),
ownNodeModules: resolveOwn('../node_modules')
Expand All@@ -49,6 +50,7 @@ if (isInCreateReactAppSource) {
appHtml: resolveApp('index.html'),
appFavicon: resolveApp('favicon.ico'),
appPackageJson: resolveApp('package.json'),
appStatic: resolveApp('static'),
appSrc: resolveApp('src'),
appNodeModules: resolveApp('node_modules'),
// this is empty with npm3 but node resolution searches higher anyway:
Expand All@@ -61,6 +63,7 @@ if (isInCreateReactAppSource) {
appHtml: resolveApp('index.html'),
appFavicon: resolveApp('favicon.ico'),
appPackageJson: resolveApp('package.json'),
appStatic: resolveApp('static'),
appSrc: resolveApp('src'),
appNodeModules: resolveApp('node_modules'),
ownNodeModules: resolveApp('node_modules')
Expand Down
5 changes: 5 additions & 0 deletions config/webpack.config.dev.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,6 +13,7 @@ var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
var WatchMissingNodeModulesPlugin = require('../scripts/utils/WatchMissingNodeModulesPlugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var paths = require('./paths');
var env = require('./env');

Expand DownExpand Up@@ -170,6 +171,10 @@ module.exports = {
template: paths.appHtml,
favicon: paths.appFavicon,
}),
// Copy the static folder as-is to the build folder
new CopyWebpackPlugin([
{ from: paths.appStatic, to: 'static' }
]),
// Makes some environment variables available to the JS code, for example:
// if (process.env.NODE_ENV === 'development') { ... }. See `env.js`.
new webpack.DefinePlugin(env),
Expand Down
5 changes: 5 additions & 0 deletions config/webpack.config.prod.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,7 @@ var path = require('path');
var autoprefixer = require('autoprefixer');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var url = require('url');
var paths = require('./paths');
Expand DownExpand Up@@ -203,6 +204,10 @@ module.exports = {
new webpack.optimize.OccurrenceOrderPlugin(),
// Try to dedupe duplicated modules, if any:
new webpack.optimize.DedupePlugin(),
// Copy the static folder as-is to the build folder
new CopyWebpackPlugin([
{ from: paths.appStatic, to: 'static' }
]),
// Minify the code.
new webpack.optimize.UglifyJsPlugin({
compress: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,6 +47,7 @@
"case-sensitive-paths-webpack-plugin": "1.1.2",
"chalk": "1.1.3",
"connect-history-api-fallback": "1.2.0",
"copy-webpack-plugin": "3.0.1",
"cross-spawn": "4.0.0",
"css-loader": "0.23.1",
"detect-port": "1.0.0",
Expand Down