1
1
const CopyWebpackPlugin = require ( 'copy-webpack-plugin' )
2
2
const ZipPlugin = require ( 'zip-webpack-plugin' ) ;
3
3
const CleanWebpackPlugin = require ( 'clean-webpack-plugin' ) ;
4
+ const CreateFileWebpack = require ( 'create-file-webpack' )
4
5
const path = require ( 'path' ) ;
5
6
7
+ const manifest = require ( "./manifest" ) ;
6
8
const { version } = require ( './package.json' ) ;
7
9
8
10
module . exports = [
@@ -28,10 +30,14 @@ module.exports = [
28
30
cleanOnceBeforeBuildPatterns : [ '**\/*' , path . join ( process . cwd ( ) , 'build/*_Chrome.zip' ) ] ,
29
31
dangerouslyAllowCleanPatternsOutsideProject : true
30
32
} ) ,
33
+ new CreateFileWebpack ( {
34
+ fileName : 'manifest.json' ,
35
+ path : __dirname + '/build/chrome' ,
36
+ content : JSON . stringify ( manifest )
37
+ } ) ,
31
38
new CopyWebpackPlugin ( [
32
39
{ from : 'css/chrome.css' , to : 'css/index.css' } ,
33
40
{ from : 'index.html' , to : 'index.html' } ,
34
- { from : 'manifest.json' , to : 'manifest.json' } ,
35
41
{ from : 'img' , to : 'img' } ,
36
42
{ from : 'font-awesome' , to : 'font-awesome' }
37
43
] ) ,
@@ -63,10 +69,14 @@ module.exports = [
63
69
cleanOnceBeforeBuildPatterns : [ '**\/*' , path . join ( process . cwd ( ) , 'build/*_Firefox.zip' ) ] ,
64
70
dangerouslyAllowCleanPatternsOutsideProject : true
65
71
} ) ,
72
+ new CreateFileWebpack ( {
73
+ fileName : 'manifest.json' ,
74
+ path : __dirname + '/build/firefox' ,
75
+ content : JSON . stringify ( manifest )
76
+ } ) ,
66
77
new CopyWebpackPlugin ( [
67
78
{ from : 'css/firefox.css' , to : 'css/index.css' } ,
68
79
{ from : 'index.html' , to : 'index.html' } ,
69
- { from : 'manifest.json' , to : 'manifest.json' } ,
70
80
{ from : 'img' , to : 'img' } ,
71
81
{ from : 'font-awesome' , to : 'font-awesome' }
72
82
] ) ,
0 commit comments