Skip to content

Commit 87892a5

Browse files
committed
fix(build): copy plugin should be loaded in all cases
close #1073
1 parent 5c5e0b8 commit 87892a5

File tree

1 file changed

+9
-9
lines changed
  • packages/@vue/cli-service/lib/config

1 file changed

+9
-9
lines changed

packages/@vue/cli-service/lib/config/app.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ module.exports = (api, options) => {
3838
)
3939
])
4040

41+
// copy static assets in public/
42+
webpackConfig
43+
.plugin('copy')
44+
.use(require('copy-webpack-plugin'), [[{
45+
from: api.resolve('public'),
46+
to: api.resolve(options.outputDir),
47+
ignore: ['index.html', '.DS_Store']
48+
}]])
49+
4150
if (process.env.NODE_ENV === 'production') {
4251
// minify HTML
4352
webpackConfig
@@ -142,15 +151,6 @@ module.exports = (api, options) => {
142151
}])
143152
.after('preload')
144153
}
145-
146-
// copy static assets in public/
147-
webpackConfig
148-
.plugin('copy')
149-
.use(require('copy-webpack-plugin'), [[{
150-
from: api.resolve('public'),
151-
to: api.resolve(options.outputDir),
152-
ignore: ['index.html', '.DS_Store']
153-
}]])
154154
}
155155
})
156156
}

0 commit comments

Comments
 (0)