Skip to content

Commit b8cbde8

Browse files
Merge pull request #24 from RobotlegsJS/deploy-example
Deploy example
2 parents 34d6a0e + c35d7ba commit b8cbde8

File tree

5 files changed

+155
-1027
lines changed

5 files changed

+155
-1027
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
.idea
22
.nyc_output
33
coverage
4+
dist
45
dist/lib
56
dist-test
7+
gh-pages
68
lib
79
lib-test
810
node_modules

deploy-example.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
yarn build:example
2+
rm -Rf gh-pages
3+
mkdir -p gh-pages
4+
cd gh-pages
5+
git init .
6+
git remote add origin [email protected]:RobotlegsJS/RobotlegsJS-CreateJS.git
7+
cp -r ../dist/* .
8+
git checkout -b gh-pages
9+
git add .
10+
git commit -m "update example build"
11+
git push origin gh-pages --force

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
"compile:example": "tsc -p tsconfig.example.json -d --importHelpers",
2323
"dev": "webpack",
2424
"build": "webpack --env.production",
25+
"build:example": "webpack --config ./webpack.example.config.js --env.production",
26+
"deploy:example": "./deploy-example.sh",
2527
"prepare": "npm run clean-up && npm run compile:src",
2628
"prepublishOnly": "publish-please guard",
2729
"publish-please": "npm run tslint && npm run autoformat && npm run clean-up && npm run test && publish-please"
@@ -72,6 +74,8 @@
7274
"bluebird": "^3.5.3",
7375
"browserify-versionify": "^1.0.6",
7476
"chai": "^4.2.0",
77+
"clean-webpack-plugin": "^1.0.0",
78+
"copy-webpack-plugin": "^4.6.0",
7579
"easeljs": "^1.0.2",
7680
"es6-map": "^0.1.5",
7781
"es6-symbol": "^3.1.1",

webpack.example.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ const webpack = require("webpack");
22
const path = require("path");
33
const HtmlWebpackPlugin = require("html-webpack-plugin");
44
const ConcatPlugin = require("webpack-concat-plugin");
5+
const CopyPlugin = require("copy-webpack-plugin");
6+
const CleanWebpackPlugin = require("clean-webpack-plugin");
57
const OpenBrowserPlugin = require("open-browser-webpack-plugin");
68
const SimpleProgressPlugin = require("webpack-simple-progress-plugin");
79

@@ -38,6 +40,8 @@ module.exports = options => {
3840
},
3941

4042
plugins: [
43+
new CleanWebpackPlugin([ "dist" ]),
44+
4145
new HtmlWebpackPlugin({
4246
template: path.resolve("static/index.html"),
4347
inject: false
@@ -47,6 +51,8 @@ module.exports = options => {
4751
path.resolve(__dirname, "./node_modules/easeljs/lib/easeljs.js")
4852
])),
4953

54+
new CopyPlugin([{ from: "static", to: "." }]),
55+
5056
new SimpleProgressPlugin(),
5157

5258
new OpenBrowserPlugin({ url: "http://0.0.0.0:8080/webpack-dev-server/" })

0 commit comments

Comments
 (0)