-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Build improvements #2076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
CompuIves
merged 18 commits into
codesandbox:master
from
lbogdan:experiment/build-improvements
Jun 22, 2019
Merged
Build improvements #2076
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
79916c2
[WIP] Build improvements.
lbogdan 057d47a
Fix production build.
lbogdan 27145ec
Extract static assets to config/build.js and use them in both dev and…
lbogdan d0b7869
Cleanup.
lbogdan fd8d12e
Update yarn.lock.
lbogdan 5ef8a8a
Update standalone-packages/vscode-textmate/package-lock.json.
lbogdan b9de1f9
Bump CircleCI cache keys version.
lbogdan f309784
Revert "Update standalone-packages/vscode-textmate/package-lock.json."
lbogdan 58e420f
Small improvements.
lbogdan 0d5ef6b
Update webpack to latest 4.35.0.
lbogdan 39fcae1
CodeMirror: remove auto-complete, so we're not bundling tern.
lbogdan 31b3c20
Remove unneeded gulp tasks.
lbogdan 51ee807
Update webpack-dev-server to latest 3.7.2 and remove unused webpack-d…
lbogdan a6877b2
Show the updated module which triggers re-compiling.
lbogdan e7db9e6
Don't use thread-loader while linting.
lbogdan 25d4839
Extract tern dep to codesandbox-deps and re-add CodeMirror bits.
lbogdan e142676
Disable console clearing on Windows by default and
lbogdan 2ab9b69
Merge branch 'master' into experiment/build-improvements
CompuIves File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| const fs = require('fs-extra'); | ||
| const path = require('path'); | ||
|
|
||
| const __DEV__ = process.env.NODE_ENV === 'development'; | ||
|
|
||
| const assets = [ | ||
| { | ||
| from: 'packages/app/www', | ||
| to: '', | ||
| }, | ||
| { | ||
| from: 'packages/homepage/public', | ||
| to: '', | ||
| }, | ||
| { | ||
| from: 'standalone-packages/monaco-editor/release/min/vs', | ||
| to: 'public/14/vs', | ||
| }, | ||
| { | ||
| from: 'standalone-packages/codesandbox-browserfs/dist', | ||
| to: 'static/browserfs2', | ||
| }, | ||
| { | ||
| from: 'standalone-packages/vscode-editor/release/min/vs', | ||
| to: 'public/vscode8', | ||
| }, | ||
| { | ||
| from: 'packages/app/public', | ||
| to: '', | ||
| }, | ||
|
|
||
| // ex-copy-webpack-plugin | ||
| { | ||
| from: 'standalone-packages/vscode-editor/release/min/vs', | ||
| to: 'public/vscode22/vs', | ||
| }, | ||
| { | ||
| from: 'standalone-packages/vscode-extensions/out', | ||
| to: 'public/vscode-extensions/v8', | ||
| }, | ||
| { | ||
| from: 'node_modules/onigasm/lib/onigasm.wasm', | ||
| to: 'public/onigasm/2.2.1/onigasm.wasm', | ||
| }, | ||
| { | ||
| from: | ||
| 'standalone-packages/vscode-textmate/node_modules/onigasm/lib/onigasm.wasm', | ||
| to: 'public/onigasm/2.1.0/onigasm.wasm', | ||
| }, | ||
| { | ||
| from: 'node_modules/monaco-vue/release/min', | ||
| to: 'public/14/vs/language/vue', | ||
| }, | ||
| { | ||
| from: 'standalone-packages/monaco-editor/release/min/vs', | ||
| to: 'public/14/vs', | ||
| }, | ||
| { | ||
| from: 'packages/app/static', | ||
| to: 'static', | ||
| }, | ||
| { | ||
| from: __DEV__ | ||
| ? 'standalone-packages/codesandbox-browserfs/build' | ||
| : 'standalone-packages/codesandbox-browserfs/dist', | ||
| to: 'static/browserfs3', | ||
| }, | ||
| ]; | ||
|
|
||
| const rootPath = path.resolve(__dirname, '../../..'); | ||
| const buildPath = path.resolve(rootPath, 'www'); | ||
|
|
||
| assets.forEach(({ from, to }) => { | ||
| const srcPath = path.resolve(rootPath, from); | ||
| const dstPath = path.resolve(buildPath, to); | ||
| console.log(`${srcPath} => ${dstPath}`); | ||
| fs.copySync(srcPath, dstPath); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can start showing this again after we remove
CopyWebpackPlugin, I commented this because it was also showing all files copied by the plugin (+50,000 files), which made the build actually slow because of slow stdout.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can / should do something more involved as a separate step in the build process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, like a check? I'd agree with that, if you can include it in this PR that would be nice, if not we could uncomment this for now in the meantime.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But how does that work, anyway, as in CI we don't have the previous build's assets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do! We cache them between builds in CircleCI.