Generate /playground from /src/playground

The playground now must be loaded with a URL that ends in "/playground/"
or "/playground/index.html"; loading at "/" will no longer work.

The /playground folder is now purely an output of the build process,
rather than being a mix of build output and static content. The static
content that was previously there (namely, index.html) has been moved
into /src/playground. The `contentBase` has been set to `false` to avoid
confusion between current, in-memory build output and stale, on-disk
build output.
This commit is contained in:
Christopher Willis-Ford 2017-03-08 14:47:14 -08:00
parent f8c45d8552
commit 10db85594f
4 changed files with 13 additions and 12 deletions

View file

@ -1,17 +1,12 @@
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
const base = {
devServer: {
contentBase: path.resolve(__dirname, 'playground'),
contentBase: false,
host: '0.0.0.0',
watchOptions: {
aggregateTimeout: 300,
poll: 1000
},
stats: {
colors: true
}
port: process.env.PORT || 8061
},
devtool: 'source-map',
module: {
@ -47,7 +42,14 @@ module.exports = [
output: {
path: path.resolve(__dirname, 'playground'),
filename: '[name].js'
}
},
plugins: base.plugins.concat([
new CopyWebpackPlugin([
{
from: 'src/playground'
}
])
])
}),
// Web-compatible
Object.assign({}, base, {