Skip to content

Commit f2208ad

Browse files
committed
新增yarn doc配置
1 parent 9e6db2a commit f2208ad

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/.idea
22
/dist/*
33
/test-results/
4+
/doc/
45
# Logs
56
logs
67
*.log

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
],
1010
"scripts": {
1111
"start": "cross-env NODE_ENV=development webpack-dev-server --config webpack.config.dev.js",
12+
"doc": "cross-env NODE_ENV=production webpack --config webpack.config.doc.js",
1213
"build": "cross-env NODE_ENV=production webpack --config webpack.config.prod.js",
1314
"test": "cross-env NODE_ENV=test jest --config=jest.config.js --runInBand",
1415
"ci": "cross-env NODE_ENV=test JEST_JUNIT_OUTPUT=./test-results/jest/results.xml jest --config=jest.config.ci.js"

webpack.config.doc.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const base = require('./webpack.config')
2+
const path = require('path')
3+
const HtmlWebpackPlugin = require('html-webpack-plugin');
4+
module.exports = Object.assign({}, base, {
5+
mode: 'production',
6+
output: {
7+
path: path.resolve(__dirname, 'doc'),
8+
},
9+
entry: {
10+
example: './example.tsx',
11+
},
12+
plugins: [
13+
new HtmlWebpackPlugin({
14+
template: 'example.html',
15+
filename: 'example.html'
16+
})
17+
],
18+
})

0 commit comments

Comments
 (0)