-
Notifications
You must be signed in to change notification settings - Fork 3
/
next.config.js
54 lines (51 loc) · 1.81 KB
/
next.config.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
53
54
const path = require('path');
const process = require('process');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const pathBuilder = (subpath) => path.join(process.cwd(), subpath);
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config, { webpack }) => {
config.plugins.push(
new CopyWebpackPlugin({
patterns: [
{
from: pathBuilder ('node_modules/cesium/Build/Cesium/Workers'),
to: '../public/cesium/Workers',
info: { minimized: true }
}
]
}),
new CopyWebpackPlugin({
patterns: [
{
from: pathBuilder ('node_modules/cesium/Build/Cesium/ThirdParty'),
to: '../public/cesium/ThirdParty',
info: { minimized: true }
}
]
}),
new CopyWebpackPlugin({
patterns: [
{
from: pathBuilder ('node_modules/cesium/Build/Cesium/Assets'),
to: '../public/cesium/Assets',
info: { minimized: true }
}
]
}),
new CopyWebpackPlugin({
patterns: [
{
from: pathBuilder ('node_modules/cesium/Build/Cesium/Widgets'),
to: '../public/cesium/Widgets',
info: { minimized: true }
}
]
}),
new webpack.DefinePlugin({ CESIUM_BASE_URL: JSON.stringify('/cesium') })
);
return config
},
output: 'standalone'
};
module.exports = nextConfig;