|
1 | 1 | const webpack = require('webpack')
|
2 | 2 | const path = require('path')
|
3 |
| -const CopyPlugin = require('copy-webpack-plugin') |
4 | 3 | const HtmlWebpackPlugin = require('html-webpack-plugin')
|
5 |
| -const WorkboxPlugin = require('workbox-webpack-plugin') |
6 | 4 | // https://webpack.js.org/guides/production/
|
7 | 5 |
|
8 | 6 | const config = {
|
@@ -57,26 +55,21 @@ const config = {
|
57 | 55 | new webpack.NormalModuleReplacementPlugin(
|
58 | 56 | /prismarine-viewer[/|\\]viewer[/|\\]lib[/|\\]utils/,
|
59 | 57 | './utils.web.js'
|
60 |
| - ), |
61 |
| - new WorkboxPlugin.GenerateSW({ |
62 |
| - // these options encourage the ServiceWorkers to get in there fast |
63 |
| - // and not allow any straggling "old" SWs to hang around |
64 |
| - clientsClaim: true, |
65 |
| - skipWaiting: true, |
66 |
| - include: ['index.html', 'manifest.json'] // not caching a lot as anyway this works only online |
67 |
| - }), |
68 |
| - new CopyPlugin({ |
69 |
| - patterns: [ |
70 |
| - { from: path.join(__dirname, '/styles.css'), to: './styles.css' }, |
71 |
| - { from: path.join(__dirname, '/node_modules/prismarine-viewer/public/blocksStates/'), to: './blocksStates/' }, |
72 |
| - { from: path.join(__dirname, '/node_modules/prismarine-viewer/public/textures/'), to: './textures/' }, |
73 |
| - { from: path.join(__dirname, '/node_modules/prismarine-viewer/public/worker.js'), to: './' }, |
74 |
| - { from: path.join(__dirname, '/node_modules/prismarine-viewer/public/supportedVersions.json'), to: './' }, |
75 |
| - { from: path.join(__dirname, 'assets/'), to: './' }, |
76 |
| - { from: path.join(__dirname, 'extra-textures/'), to: './extra-textures/' }, |
77 |
| - { from: path.join(__dirname, 'config.json'), to: './config.json' } |
78 |
| - ] |
79 |
| - }) |
| 58 | + ) |
| 59 | + ], |
| 60 | + // The directories that can be optionally symlinked |
| 61 | + [Symbol.for('webpack_directories')]: [ |
| 62 | + { from: path.join(__dirname, '/node_modules/prismarine-viewer/public/blocksStates/'), to: './blocksStates/' }, |
| 63 | + { from: path.join(__dirname, '/node_modules/prismarine-viewer/public/textures/'), to: './textures/' }, |
| 64 | + { from: path.join(__dirname, 'extra-textures/'), to: './extra-textures/' } |
| 65 | + ], |
| 66 | + // The files that will be copied |
| 67 | + [Symbol.for('webpack_files')]: [ |
| 68 | + { from: path.join(__dirname, '/styles.css'), to: './styles.css' }, |
| 69 | + { from: path.join(__dirname, '/node_modules/prismarine-viewer/public/worker.js'), to: './' }, |
| 70 | + { from: path.join(__dirname, '/node_modules/prismarine-viewer/public/supportedVersions.json'), to: './' }, |
| 71 | + { from: path.join(__dirname, 'assets/'), to: './' }, |
| 72 | + { from: path.join(__dirname, 'config.json'), to: './config.json' } |
80 | 73 | ]
|
81 | 74 | }
|
82 | 75 |
|
|
0 commit comments