mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-05-15 07:51:04 -04:00
Update dev server to only serve the playground
Now that we don't rely on node_modules, we can update the content base to just `playground` and just look at it from http://localhost:8080/
This commit is contained in:
parent
e9cb0a5102
commit
6b1d2a8eb6
7 changed files with 19 additions and 18 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -11,3 +11,7 @@ npm-*
|
||||||
/dist.js
|
/dist.js
|
||||||
/vm.js
|
/vm.js
|
||||||
/vm.min.js
|
/vm.min.js
|
||||||
|
/playground/media
|
||||||
|
/playground/vendor.js
|
||||||
|
/playground/vm.js
|
||||||
|
/playground/zenburn.css
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -13,7 +13,7 @@ watch:
|
||||||
$(WEBPACK) --watch
|
$(WEBPACK) --watch
|
||||||
|
|
||||||
serve:
|
serve:
|
||||||
$(WEBPACK_DEV_SERVER) --host 0.0.0.0 --content-base ./
|
$(WEBPACK_DEV_SERVER)
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ StartServerWindows.bat
|
||||||
```
|
```
|
||||||
|
|
||||||
## Playground
|
## 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.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
@echo off
|
@echo off
|
||||||
node_modules\.bin\webpack-dev-server --host 0.0.0.0 --content-base .
|
node_modules\.bin\webpack-dev-server --host 0.0.0.0 --content-base .\playground
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="refresh" content="0; URL='/playground'" />
|
|
||||||
<title>Redirect to playground</title>
|
|
||||||
</head>
|
|
||||||
</html>
|
|
|
@ -12,7 +12,7 @@
|
||||||
"main": "./dist.js",
|
"main": "./dist.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepublish": "./node_modules/.bin/webpack --bail",
|
"prepublish": "./node_modules/.bin/webpack --bail",
|
||||||
"start": "webpack-dev-server --host 0.0.0.0 --content-base .",
|
"start": "make serve",
|
||||||
"test": "make test"
|
"test": "make test"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
var CopyWebpackPlugin = require('copy-webpack-plugin');
|
var CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
var defaultsDeep = require('lodash.defaultsdeep');
|
var defaultsDeep = require('lodash.defaultsdeep');
|
||||||
|
var path = require('path');
|
||||||
var webpack = require('webpack');
|
var webpack = require('webpack');
|
||||||
|
|
||||||
var base = {
|
var base = {
|
||||||
|
devServer: {
|
||||||
|
contentBase: path.resolve(__dirname, 'playground'),
|
||||||
|
host: '0.0.0.0'
|
||||||
|
},
|
||||||
module: {
|
module: {
|
||||||
loaders: [
|
loaders: [
|
||||||
{
|
{
|
||||||
|
@ -57,8 +62,8 @@ module.exports = [
|
||||||
// Playground
|
// Playground
|
||||||
defaultsDeep({}, base, {
|
defaultsDeep({}, base, {
|
||||||
entry: {
|
entry: {
|
||||||
'playground/vm': './src/index.js',
|
'vm': './src/index.js',
|
||||||
'playground/vendor': [
|
'vendor': [
|
||||||
// FPS counter
|
// FPS counter
|
||||||
'stats.js/build/stats.min.js',
|
'stats.js/build/stats.min.js',
|
||||||
// Syntax highlighter
|
// Syntax highlighter
|
||||||
|
@ -70,7 +75,7 @@ module.exports = [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: __dirname,
|
path: path.resolve(__dirname, 'playground'),
|
||||||
filename: '[name].js'
|
filename: '[name].js'
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
|
@ -100,10 +105,9 @@ module.exports = [
|
||||||
plugins: base.plugins.concat([
|
plugins: base.plugins.concat([
|
||||||
new CopyWebpackPlugin([{
|
new CopyWebpackPlugin([{
|
||||||
from: 'node_modules/scratch-blocks/media',
|
from: 'node_modules/scratch-blocks/media',
|
||||||
to: 'playground/media'
|
to: 'media'
|
||||||
}, {
|
}, {
|
||||||
from: 'node_modules/highlightjs/styles/zenburn.css',
|
from: 'node_modules/highlightjs/styles/zenburn.css'
|
||||||
to: 'playground'
|
|
||||||
}])
|
}])
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue