diff --git a/.gitignore b/.gitignore index b896c5ade..753e3f651 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,7 @@ npm-* /dist.js /vm.js /vm.min.js +/playground/media +/playground/vendor.js +/playground/vm.js +/playground/zenburn.css diff --git a/Makefile b/Makefile index c3614f5ac..14a5870ba 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ watch: $(WEBPACK) --watch serve: - $(WEBPACK_DEV_SERVER) --host 0.0.0.0 --content-base ./ + $(WEBPACK_DEV_SERVER) # ------------------------------------------------------------------------------ diff --git a/README.md b/README.md index 55cf93f9e..032dac985 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ StartServerWindows.bat ``` ## Playground -To run the Playground, make sure the dev server's running and go to [http://localhost:8080/](http://localhost:8080/) - you will be redirected to the playground, which demonstrates various tools and internal state. +To run the Playground, make sure the dev server's running and go to [http://localhost:8080/](http://localhost:8080/) - you will be directed to the playground, which demonstrates various tools and internal state.  diff --git a/StartServerWindows.bat b/StartServerWindows.bat index b81638194..73a4d84db 100644 --- a/StartServerWindows.bat +++ b/StartServerWindows.bat @@ -1,2 +1,2 @@ -@echo off -node_modules\.bin\webpack-dev-server --host 0.0.0.0 --content-base . +@echo off +node_modules\.bin\webpack-dev-server --host 0.0.0.0 --content-base .\playground diff --git a/index.html b/index.html deleted file mode 100644 index 42edce430..000000000 --- a/index.html +++ /dev/null @@ -1,7 +0,0 @@ -<!DOCTYPE HTML> -<html> -<head> - <meta http-equiv="refresh" content="0; URL='/playground'" /> - <title>Redirect to playground</title> -</head> -</html> diff --git a/package.json b/package.json index 02b23a0c8..21b910414 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "main": "./dist.js", "scripts": { "prepublish": "./node_modules/.bin/webpack --bail", - "start": "webpack-dev-server --host 0.0.0.0 --content-base .", + "start": "make serve", "test": "make test" }, "dependencies": {}, diff --git a/webpack.config.js b/webpack.config.js index aa2e50f7b..6d08c73ac 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,8 +1,13 @@ var CopyWebpackPlugin = require('copy-webpack-plugin'); var defaultsDeep = require('lodash.defaultsdeep'); +var path = require('path'); var webpack = require('webpack'); var base = { + devServer: { + contentBase: path.resolve(__dirname, 'playground'), + host: '0.0.0.0' + }, module: { loaders: [ { @@ -57,8 +62,8 @@ module.exports = [ // Playground defaultsDeep({}, base, { entry: { - 'playground/vm': './src/index.js', - 'playground/vendor': [ + 'vm': './src/index.js', + 'vendor': [ // FPS counter 'stats.js/build/stats.min.js', // Syntax highlighter @@ -70,7 +75,7 @@ module.exports = [ ] }, output: { - path: __dirname, + path: path.resolve(__dirname, 'playground'), filename: '[name].js' }, module: { @@ -100,10 +105,9 @@ module.exports = [ plugins: base.plugins.concat([ new CopyWebpackPlugin([{ from: 'node_modules/scratch-blocks/media', - to: 'playground/media' + to: 'media' }, { - from: 'node_modules/highlightjs/styles/zenburn.css', - to: 'playground' + from: 'node_modules/highlightjs/styles/zenburn.css' }]) ]) })