Merge pull request #1481 from h3poteto/fix/copy-plugin

Fix options for copy-webpack-plugin
This commit is contained in:
AkiraFukushima 2020-05-28 00:48:33 +09:00 committed by GitHub
commit 9d964fd5e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 22 deletions

View File

@ -60,13 +60,18 @@ let mainConfig = {
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new CopyWebpackPlugin([
{
from: path.join(__dirname, '../src/config/locales'),
to: path.join(__dirname, '../dist/electron/locales'),
ignore: ['.*', '*~']
}
])
new CopyWebpackPlugin({
patterns: [
{
from: path.join(__dirname, '../src/config/locales'),
to: path.join(__dirname, '../dist/electron/locales'),
globOptions: {
gitignore: true,
ignore: ['.*', '*~']
}
}
]
})
],
resolve: {
alias: {

View File

@ -180,13 +180,18 @@ if (process.env.NODE_ENV === 'production') {
rendererConfig.devtool = ''
rendererConfig.mode = 'production'
rendererConfig.plugins.push(
new CopyWebpackPlugin([
{
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/electron/static'),
ignore: ['.*', '*~']
}
]),
new CopyWebpackPlugin({
patterns: [
{
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/electron/static'),
globOptions: {
gitignore: true,
ignore: ['.*', '*~']
}
}
]
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
}),

View File

@ -130,13 +130,18 @@ if (process.env.NODE_ENV === 'production') {
webConfig.devtool = ''
webConfig.mode = 'production'
webConfig.plugins.push(
new CopyWebpackPlugin([
{
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/web/static'),
ignore: ['.*']
}
]),
new CopyWebpackPlugin({
patterns: [
{
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/web/static'),
globOptions: {
gitignore: true,
ignore: ['.*', '*~']
}
}
]
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
}),

3
package-lock.json generated
View File

@ -15601,7 +15601,8 @@
},
"gonzales-pe": {
"version": "4.2.3",
"resolved": "",
"resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.2.3.tgz",
"integrity": "sha512-Kjhohco0esHQnOiqqdJeNz/5fyPkOMD/d6XVjwTAoPGUFh0mCollPUTUTa2OZy4dYNAqlPIQdTiNzJTWdd9Htw==",
"dev": true,
"requires": {
"minimist": "1.1.x"