Skip to content
This repository was archived by the owner on Nov 15, 2021. It is now read-only.

Commit a0b30df

Browse files
committed
Fix #13, use bili and remove poi
- Relate #2, reason for removing poi - Relate #1, open possibility to deploy to gh-pages
1 parent ec95c12 commit a0b30df

File tree

5 files changed

+44
-69
lines changed

5 files changed

+44
-69
lines changed

template/.bilirc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "{{name}}",
3+
"moduleName": "{{pascalCase name}}",
4+
"input": [
5+
"src/components/*"
6+
],
7+
"format": ["cjs", "umd-min", "es"]
8+
}

template/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
node_modules
22
.DS_Store
33
dist/
4-
umd/
54
.storybook/dist
65
*.lock
76
out*

template/.storybook/poi.config.js

Lines changed: 0 additions & 57 deletions
This file was deleted.

template/.storybook/webpack.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{#isEnabled addons 'readme'}}
2+
const updateWebpackConfig = require('storybook-readme/env/vue/updateWebpackConfig')
3+
{{/isEnabled}}
4+
5+
module.exports = (storybookBaseConfig, configType, defaultConfig) => {
6+
// configType has a value of 'DEVELOPMENT' or 'PRODUCTION'
7+
// You can change the configuration based on that.
8+
// 'PRODUCTION' is used when building the static version of storybook.
9+
10+
/** For more info @see https://storybook.js.org/configurations/custom-webpack-config/#full-control-mode--default
11+
defaultConfig.module.rules.push({
12+
test: /\.(ts|tsx)$/,
13+
include: path.resolve(__dirname, '../src'),
14+
loader: require.resolve('ts-loader')
15+
});
16+
defaultConfig.resolve.extensions.push('.ts', '.tsx')
17+
*/
18+
19+
// Return the altered config
20+
{{#isEnabled addons 'readme'}}
21+
return updateWebpackConfig(defaultConfig)
22+
{{else}}
23+
return defaultConfig
24+
{{/isEnabled}}
25+
}

template/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
"vue",
88
"component"
99
],
10+
"unpkg": "dist/{{name}}.min.js",
11+
"jsdelivr": "dist/{{name}}.min.js",
1012
"main": "dist/{{name}}.js",
11-
"unpkg": "umd/{{name}}.js",
13+
"module": "dist/{{name}}.es.js",
1214
"files": [
1315
"dist/",
1416
"umd/",
@@ -18,13 +20,12 @@
1820
"license": "MIT",
1921
"private": false,
2022
"scripts": {
21-
"dev": "poi --config .storybook/poi.config.js --storybook --open",
22-
"build:storybook": "poi build --config .storybook/poi.config.js --storybook",
23-
"build:component": "poi build src/components/{{pascalCase name}}.vue --library",
24-
"build:component:umd": "poi build src/components/{{pascalCase name}}.vue --library {{pascalCase name}} --dist umd",
23+
"dev": "start-storybook --static-dir static",
24+
"build:storybook": "build-storybook --static-dir static --output-dir .storybook/dist",
25+
"build:component": "bili --plugin vue --jsx vue",
2526
"deploy": "surge .storybook/dist",
2627
"predeploy": "npm run build:storybook",
27-
"prepublish": "concurrently --kill-others 'npm run build:component' 'npm run build:component:umd'"
28+
"prepublish": "npm run build:component"
2829
},
2930
"devDependencies": {
3031
{{#isEnabled addons 'actions'}}
@@ -44,14 +45,13 @@
4445
{{/isEnabled}}
4546
"@storybook/addon-options": "^3.3.0",
4647
"@storybook/vue": "^3.3.0",
48+
"@storybook/cli": "^3.3.0",
4749
{{#if customBlocks}}
4850
"marked": "^0.3.0",
4951
{{/if}}
50-
"poi": "^9.4.0",
51-
"poi-preset-resolve-alias": "^1.0.0",
52-
"poi-preset-storybook": "^0.1.4",
53-
"surge": "^0.19.0",
54-
"concurrently": "^3.5.1"
52+
"bili": "^1.6.5",
53+
"rollup-plugin-vue": "^3.0.0",
54+
"surge": "^0.19.0"
5555
},
5656
"peerDependencies": {},
5757
"dependencies": {}

0 commit comments

Comments
 (0)