Serve static assets out of /_static

This commit is contained in:
MICHAEL JACKSON 2017-08-16 14:49:36 -07:00
parent 65c2aa7357
commit ce493823d3
2 changed files with 8 additions and 8 deletions

View File

@ -59,7 +59,7 @@ module.exports = {
// This does not produce a real file. It's just the virtual path that is // This does not produce a real file. It's just the virtual path that is
// served by WebpackDevServer in development. This is the JS bundle // served by WebpackDevServer in development. This is the JS bundle
// containing code from all our entry points, and the Webpack runtime. // containing code from all our entry points, and the Webpack runtime.
filename: 'static/js/bundle.js', filename: '_static/js/bundle.js',
// This is the URL that app is served from. We use "/" in development. // This is the URL that app is served from. We use "/" in development.
publicPath: publicPath publicPath: publicPath
}, },
@ -119,7 +119,7 @@ module.exports = {
loader: 'url', loader: 'url',
query: { query: {
limit: 10000, limit: 10000,
name: 'static/media/[name].[hash:8].[ext]' name: '_static/media/[name].[hash:8].[ext]'
} }
}, },
// Process JS with Babel. // Process JS with Babel.
@ -155,7 +155,7 @@ module.exports = {
test: /\.svg$/, test: /\.svg$/,
loader: 'file', loader: 'file',
query: { query: {
name: 'static/media/[name].[hash:8].[ext]' name: '_static/media/[name].[hash:8].[ext]'
} }
}, },
// HTML loader for Markdown files. // HTML loader for Markdown files.

View File

@ -31,7 +31,7 @@ if (env.stringified['process.env'].NODE_ENV !== '"production"') {
} }
// Note: defined here because it will be used more than once. // Note: defined here because it will be used more than once.
const cssFilename = 'static/css/[name].[contenthash:8].css'; const cssFilename = '_static/css/[name].[contenthash:8].css';
// ExtractTextPlugin expects the build output to be flat. // ExtractTextPlugin expects the build output to be flat.
// (See https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/27) // (See https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/27)
@ -62,8 +62,8 @@ module.exports = {
// Generated JS file names (with nested folders). // Generated JS file names (with nested folders).
// There will be one main bundle, and one file per asynchronous chunk. // There will be one main bundle, and one file per asynchronous chunk.
// We don't currently advertise code splitting but Webpack supports it. // We don't currently advertise code splitting but Webpack supports it.
filename: 'static/js/[name].[chunkhash:8].js', filename: '_static/js/[name].[chunkhash:8].js',
chunkFilename: 'static/js/[name].[chunkhash:8].chunk.js', chunkFilename: '_static/js/[name].[chunkhash:8].chunk.js',
// We inferred the "public path" (such as / or /my-project) from homepage. // We inferred the "public path" (such as / or /my-project) from homepage.
publicPath: publicPath publicPath: publicPath
}, },
@ -117,7 +117,7 @@ module.exports = {
loader: 'url', loader: 'url',
query: { query: {
limit: 10000, limit: 10000,
name: 'static/media/[name].[hash:8].[ext]' name: '_static/media/[name].[hash:8].[ext]'
} }
}, },
// Process JS with Babel. // Process JS with Babel.
@ -159,7 +159,7 @@ module.exports = {
test: /\.svg$/, test: /\.svg$/,
loader: 'file', loader: 'file',
query: { query: {
name: 'static/media/[name].[hash:8].[ext]' name: '_static/media/[name].[hash:8].[ext]'
} }
}, },
// HTML loader for Markdown files. // HTML loader for Markdown files.