Skip to content

Commit

Permalink
fix(build): copy plugin should be loaded in all cases
Browse files Browse the repository at this point in the history
close #1073
  • Loading branch information
yyx990803 committed Apr 27, 2018
1 parent 5c5e0b8 commit 87892a5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/@vue/cli-service/lib/config/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ module.exports = (api, options) => {
)
])

// copy static assets in public/
webpackConfig
.plugin('copy')
.use(require('copy-webpack-plugin'), [[{
from: api.resolve('public'),
to: api.resolve(options.outputDir),
ignore: ['index.html', '.DS_Store']
}]])

if (process.env.NODE_ENV === 'production') {
// minify HTML
webpackConfig
Expand Down Expand Up @@ -142,15 +151,6 @@ module.exports = (api, options) => {
}])
.after('preload')
}

// copy static assets in public/
webpackConfig
.plugin('copy')
.use(require('copy-webpack-plugin'), [[{
from: api.resolve('public'),
to: api.resolve(options.outputDir),
ignore: ['index.html', '.DS_Store']
}]])
}
})
}

0 comments on commit 87892a5

Please sign in to comment.