Skip to content

Commit

Permalink
Use webpack to bundle the playground (prettier#4299)
Browse files Browse the repository at this point in the history
  • Loading branch information
duailibe authored Apr 11, 2018
2 parents 46c8a4c + a3be9f5 commit 99300d9
Show file tree
Hide file tree
Showing 7 changed files with 3,742 additions and 66 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
/test.js
/dist/
**/node_modules/**
/website/build/
/website/static/lib/
/tests_integration/cli/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/website/node_modules
/website/build
/website/i18n
/website/static/playground.js
/website/static/lib
.DS_Store
coverage
Expand Down
4 changes: 4 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,7 @@ If you wish to manually publish your website with the `publish-gh-pages` script,
```
DEPLOY_USER=deltice GIT_USER=test-site-bot CIRCLE_PROJECT_USERNAME=deltice CIRCLE_PROJECT_REPONAME=test-site CIRCLE_BRANCH=master npm run publish-gh-pages
```

## Playground

The playground is not integrated with the Docusaurus infrastructure. If you want to edit something in the playground, you need to run `yarn start` to start the Docusaurus server and `webpack --watch` in a separate shell to compile the playground changes.
8 changes: 6 additions & 2 deletions website/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
{
"license": "MIT",
"scripts": {
"build": "docusaurus-build",
"build": "webpack -p && docusaurus-build",
"publish-gh-pages": "docusaurus-publish",
"start": "docusaurus-start",
"svgo": "svgo --pretty --indent=2 --config=svgo.yml",
"svgo-all": "find static | grep '\\.svg$' | xargs -Iz -n 1 yarn svgo z"
},
"devDependencies": {
"@sandhose/prettier-animated-logo": "1.0.3",
"babel-loader": "7.1.4",
"babel-preset-env": "1.6.1",
"docusaurus": "1.0.5",
"js-yaml": "3.10.0",
"svgo": "1.0.4",
"sw-toolbox": "3.6.0"
"sw-toolbox": "3.6.0",
"webpack": "4.5.0",
"webpack-cli": "2.0.14"
}
}
File renamed without changes.
23 changes: 23 additions & 0 deletions website/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"use strict";

module.exports = {
entry: {
playground: "./playground/index.js"
},
output: {
filename: "[name].js",
path: __dirname + "/static/"
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader",
options: {
presets: ["env"]
}
}
]
}
};
Loading

0 comments on commit 99300d9

Please sign in to comment.