Skip to content

Commit 9944972

Browse files
committed
fix: move the build files to the right folder
closes #615
1 parent d453d4e commit 9944972

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ test/cypress/videos/
2525
/examples/*/dist/css/*.css
2626
/examples/*/dist/index.html
2727
/examples/*/dist/report.html
28+
/examples/*/dist/favicon.ico
2829

2930
# docs generted using run.cli
3031
/examples/*/docs/components/**/*.md

packages/vue-cli-plugin-styleguidist/index.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const { default: styleguidist } = require('vue-styleguidist')
22
const merge = require('webpack-merge')
33

4-
module.exports = api => {
4+
module.exports = (api, options) => {
55
api.configureWebpack(() => ({
66
// make sure that the docs blocks
77
// are ignored during normal serve & build
@@ -25,7 +25,7 @@ module.exports = api => {
2525
}
2626
},
2727
args => {
28-
getStyleguidist(args, api).binutils.build()
28+
getStyleguidist(args, api, options).binutils.build()
2929
}
3030
)
3131

@@ -40,7 +40,7 @@ module.exports = api => {
4040
},
4141

4242
args => {
43-
const server = getStyleguidist(args, api).binutils.server(args.open).app
43+
const server = getStyleguidist(args, api, options).binutils.server(args.open).app
4444

4545
// in order to avoid ghosted threads at the end of tests
4646
;['SIGINT', 'SIGTERM'].forEach(signal => {
@@ -68,13 +68,15 @@ module.exports = api => {
6868
)
6969
}
7070

71-
function getStyleguidist(args, api) {
71+
function getStyleguidist(args, api, options) {
7272
const conf = api.resolve(args.config || './styleguide.config.js')
73-
const userWebpackConfig = conf && conf.length ? require(conf).webpackConfig : {}
74-
73+
const sgConf = conf && conf.length ? require(conf) : {}
74+
const userWebpackConfig = sgConf.webpackConfig
75+
options.outputDir = sgConf.styleguideDir
76+
const cliWebpackConfig = getConfig(api)
7577
return styleguidist(
7678
conf,
77-
config => (config.webpackConfig = merge(getConfig(api), userWebpackConfig))
79+
config => (config.webpackConfig = merge(cliWebpackConfig, userWebpackConfig))
7880
)
7981
}
8082

0 commit comments

Comments
 (0)