Skip to content
Open
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: 1 addition & 2 deletions packages/blockly/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@
"minify": "gulp minify",
"package": "gulp pack",
"prepareDemos": "gulp prepareDemos",
"start": "npm run build && concurrently -n tsc,server \"tsc --watch --preserveWatchOutput --outDir \"build/src\" --declarationDir \"build/declarations\"\" \"http-server ./ -s -o /tests/playground.html -c-1\"",
"start:advanced": "npm run package && npx nx run @blockly/dev-tools:build && concurrently -n server,watch \"npx nx run @blockly/dev-tools:start\" \"npx nx watch --projects=@blockly/dev-tools --includeDependencies -- npm run build\"",
"start": "npm run package && npx nx run @blockly/dev-tools:build && concurrently -n watch,devtools-server,core-server \"npx nx watch --projects=@blockly/dev-tools --includeDependencies -- npm run build\" \"npx nx run @blockly/dev-tools:start --no-open\" \"http-server ./ -p 8081 -s -o /tests/playground.html -c-1\"",
"tsc": "gulp tsc",
"test": "gulp test",
"test:browser": "npx mocha --config tests/browser/.mocharc.js",
Expand Down
5 changes: 4 additions & 1 deletion packages/blockly/tests/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,10 @@ <h1>Blockly Playground (<span id="version"></span>)</h1>

<p>
<input id="show" type="button" value="Show" /> -
<input id="hide" type="button" value="Hide" />
<input id="hide" type="button" value="Hide" /> -
<a href="http://localhost:8080/">Advanced</a> -

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 8080 here is assumed. We're setting blockly server to 8081 manually in the start command and the webpack dev server will default to finding the first available port starting with 8080. This shouldn't become a problem unless we start spinning up additional servers while developing, but we can look at this again at that point if it becomes a problem.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth selectively hiding this so the GitHub Pages hosted playground doesn't include it?

<a href="playgrounds/web_component.html">Web Component</a> -
<a href="multi_playground.html">Multi Playground</a>
</p>

<form id="options">
Expand Down
6 changes: 6 additions & 0 deletions packages/plugins/dev-scripts/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath);

const packageJson = require(resolveApp('package.json'));
const isTypescript = fs.existsSync(resolveApp('tsconfig.json'));
const options = process.argv.slice(2);

console.log(`Running start for ${packageJson.name}`);

Expand Down Expand Up @@ -178,6 +179,11 @@ compiler.hooks.done.tap('done', async (stats) => {
// Read the webpack devServer configuration.
const serverConfig = webpackDevServerConfig();

// If the --no-open option was passed in, respect it.
if (options.includes('--no-open')) {
serverConfig.open = false;
}

// Start the dev server.
const devServer = new WebpackDevServer(serverConfig, compiler);
devServer.startCallback((err) => {
Expand Down
Loading