|
1 | 1 | var path = require('path');
|
2 | 2 | var webpack = require('webpack');
|
3 |
| -var StringReplacePlugin = require('string-replace-webpack-plugin'); |
4 | 3 |
|
5 | 4 | // Generate queries.json file
|
6 | 5 | require('./queries-to-json');
|
@@ -58,77 +57,32 @@ module.exports = [
|
58 | 57 | { test: /images\/*\.svg$/, use: 'file-loader' },
|
59 | 58 | ],
|
60 | 59 | },
|
61 |
| - optimization: { |
62 |
| - minimize: true, |
63 |
| - }, |
64 | 60 | },
|
65 | 61 | {
|
66 | 62 | entry: [
|
67 |
| - '@babel/polyfill', |
68 | 63 | './src/ldf-client-worker.js',
|
69 | 64 | ],
|
70 | 65 | output: {
|
71 | 66 | filename: 'scripts/ldf-client-worker.min.js',
|
72 | 67 | path: path.join(__dirname, '/build'),
|
73 | 68 | libraryTarget: 'this', // Fixes hot loading of web worker not working in Webpack
|
74 | 69 | },
|
75 |
| - devtool: 'cheap-module-source-map', |
| 70 | + devtool: 'source-map', |
76 | 71 | module: {
|
77 | 72 | rules: [
|
78 | 73 | {
|
79 |
| - // This is needed because our internal graphql dependency uses .mjs files, |
80 |
| - // and Webpack's define plugin doesn't work well with it (yet). |
81 |
| - // In the future this should be removed. |
82 |
| - type: 'javascript/auto', |
83 |
| - test: /\.mjs$/, |
84 |
| - use: [] |
85 |
| - }, |
86 |
| - { // This fixes a problem where the setImmediate of asynciterator would conflict with webpack's polyfill |
87 |
| - test: /asynciterator\.js$/, |
88 |
| - loader: StringReplacePlugin.replace({ |
89 |
| - replacements: [ |
90 |
| - { |
91 |
| - pattern: /if \(typeof process !== 'undefined' && !process\.browser\)/i, |
92 |
| - replacement: function () { |
93 |
| - return 'if (true)'; |
94 |
| - }, |
95 |
| - }, |
96 |
| - ] }), |
97 |
| - }, |
98 |
| - { |
99 |
| - // Makes rdf-sink use a modularized lodash function instead of requiring lodash completely |
100 |
| - test: /rdf-sink\/index\.js$/, |
101 |
| - loader: StringReplacePlugin.replace({ |
102 |
| - replacements: [ |
103 |
| - { |
104 |
| - pattern: /lodash\/assign/i, |
105 |
| - replacement: function () { |
106 |
| - return 'lodash.assign'; |
107 |
| - }, |
108 |
| - }, |
109 |
| - ], |
110 |
| - }), |
| 74 | + test: /\.js$/, |
| 75 | + loader: 'babel-loader', |
| 76 | + exclude: /node_modules/, |
111 | 77 | },
|
112 | 78 | {
|
113 |
| - test: /\.js$/, |
114 |
| - use: { |
115 |
| - loader: 'babel-loader', |
116 |
| - options: { |
117 |
| - presets: ['@babel/preset-env'], |
118 |
| - plugins: [ |
119 |
| - require('@babel/plugin-transform-async-to-generator'), |
120 |
| - require('@babel/plugin-syntax-object-rest-spread'), |
121 |
| - ], |
122 |
| - }, |
123 |
| - }, |
| 79 | + test: /\.mjs$/, |
| 80 | + type: 'javascript/auto', |
124 | 81 | },
|
125 | 82 | ],
|
126 | 83 | },
|
127 |
| - optimization: { |
128 |
| - minimize: true, |
129 |
| - }, |
130 | 84 | plugins: [
|
131 |
| - new StringReplacePlugin(), |
| 85 | + new webpack.ProgressPlugin(), |
132 | 86 | ],
|
133 | 87 | },
|
134 | 88 | ];
|
0 commit comments