This repository has been archived by the owner on Oct 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.safari.js
52 lines (45 loc) · 1.72 KB
/
webpack.safari.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const CleanWebpackPlugin = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
const getDistPath = require('./builder/getDistPath');
const RemoveAssets = require('./builder/removeAssets');
const mode = BUILD_ENV.mode;
const monoPath = BUILD_ENV.monoPath;
const sourcePath = BUILD_ENV.sourcePath;
const outputPath = BUILD_ENV.outputPath;
const distPath = getDistPath();
const config = {
entry: {
empty: './builder/noop',
},
output: {
path: outputPath,
filename: 'empty.point'
},
mode: mode,
devtool: 'none',
plugins: [
new CleanWebpackPlugin([
outputPath
]),
new CopyWebpackPlugin([
{from: path.join(sourcePath, './manifest.json'), to: path.join(distPath, './manifest.json')},
{from: path.join(sourcePath, './_locales'), to: path.join(distPath, './_locales')},
{
from: path.join(monoPath, './browsers/safari/Info.plist'),
to: path.join(distPath, './Info.plist'),
transform: (content, path) => {
content = String(content).replace(/{VERSION}/g, BUILD_ENV.version);
return content;
}
},
{from: path.join(monoPath, './browsers/safari/Settings.plist'), to: path.join(distPath, './Settings.plist')},
{from: path.join(sourcePath, './icons'), to: path.join(distPath, './icons')},
{from: path.join(sourcePath, './icons/icon_16.png'), to: path.join(distPath, './Icon-16.png')},
{from: path.join(sourcePath, './icons/icon_32.png'), to: path.join(distPath, './Icon-32.png')},
{from: path.join(sourcePath, './icons/icon_48.png'), to: path.join(distPath, './Icon-48.png')},
]),
new RemoveAssets(['empty.point']),
],
};
module.exports = config;