@nitro-web/webpack 0.3.27 → 0.3.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -2
- package/types/webpack.config.d.ts +18 -1
- package/types/webpack.config.d.ts.map +1 -1
- package/webpack.config.js +14 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nitro-web/webpack",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.28",
|
|
4
4
|
"repository": "github:boycce/nitro-web",
|
|
5
5
|
"homepage": "https://boycce.github.io/nitro-web/",
|
|
6
6
|
"main": "./webpack.config.js",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"babel-loader": "^8.0.6",
|
|
35
35
|
"babel-plugin-macros": "^3.1.0",
|
|
36
36
|
"babel-plugin-react-html-attrs": "^2.1.0",
|
|
37
|
-
"clean-terminal-webpack-plugin": "https://github.com/boycce/clean-terminal-webpack-plugin.git",
|
|
38
37
|
"clean-webpack-plugin": "^4.0.0",
|
|
39
38
|
"copy-webpack-plugin": "^12.0.2",
|
|
40
39
|
"core-js": "^3.12.1",
|
|
@@ -176,7 +176,7 @@ export function getConfig(config: any): (env: any, argv: any) => {
|
|
|
176
176
|
};
|
|
177
177
|
minimize: boolean;
|
|
178
178
|
};
|
|
179
|
-
plugins:
|
|
179
|
+
plugins: (CopyWebpackPlugin | HtmlWebpackPlugin | MiniCssExtractPlugin | ESLintPlugin | InterpolateHtmlPlugin | CleanTerminalPlugin | CleanWebpackPlugin | webpack.DefinePlugin)[];
|
|
180
180
|
resolve: {
|
|
181
181
|
extensions: string[];
|
|
182
182
|
alias: {
|
|
@@ -196,4 +196,21 @@ export function getConfig(config: any): (env: any, argv: any) => {
|
|
|
196
196
|
ignored: RegExp;
|
|
197
197
|
};
|
|
198
198
|
}[];
|
|
199
|
+
import CopyWebpackPlugin from 'copy-webpack-plugin';
|
|
200
|
+
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
201
|
+
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
202
|
+
import ESLintPlugin from 'eslint-webpack-plugin';
|
|
203
|
+
declare class InterpolateHtmlPlugin {
|
|
204
|
+
constructor(htmlWebpackPlugin: any, replacements: any);
|
|
205
|
+
htmlWebpackPlugin: any;
|
|
206
|
+
replacements: any;
|
|
207
|
+
apply(compiler: any): void;
|
|
208
|
+
}
|
|
209
|
+
declare class CleanTerminalPlugin {
|
|
210
|
+
firstRun: boolean;
|
|
211
|
+
apply(compiler: any): void;
|
|
212
|
+
}
|
|
213
|
+
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
|
|
214
|
+
import webpack from 'webpack';
|
|
215
|
+
export {};
|
|
199
216
|
//# sourceMappingURL=webpack.config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.config.d.ts","sourceRoot":"","sources":["../webpack.config.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webpack.config.d.ts","sourceRoot":"","sources":["../webpack.config.js"],"names":[],"mappings":"AAyCO,yCAWG,QAAG,EAAE,SAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0RlB;8BA1U6B,qBAAqB;8BACrB,qBAAqB;iCAClB,yBAAyB;yBAMjC,uBAAuB;AAoUhD;IACE,uDAGC;IAFC,uBAA0C;IAC1C,kBAAgC;IAElC,2BAeC;CACF;AAED;IAEE,kBAAe;IACf,2BAOC;CACF;mCA/WkC,sBAAsB;oBAQrC,SAAS"}
|
package/webpack.config.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// import axios from '@hokify/axios'
|
|
2
2
|
// import axiosRetry from 'axios-retry'
|
|
3
3
|
import autoprefixer from 'autoprefixer'
|
|
4
|
-
import CleanTerminalPlugin from 'clean-terminal-webpack-plugin'
|
|
5
4
|
import { CleanWebpackPlugin } from 'clean-webpack-plugin'
|
|
6
5
|
import CopyWebpackPlugin from 'copy-webpack-plugin'
|
|
7
6
|
import HtmlWebpackPlugin from 'html-webpack-plugin'
|
|
@@ -309,7 +308,7 @@ export const getConfig = (config) => {
|
|
|
309
308
|
new MiniCssExtractPlugin({ filename: `assets/bundle.[name]${isBuild ? '.[contenthash]' : ''}.css` }),
|
|
310
309
|
new HtmlWebpackPlugin({ template: clientDir + 'index.html', filename: distDir + 'index.html' }),
|
|
311
310
|
new InterpolateHtmlPlugin(HtmlWebpackPlugin, { PUBLIC_PATH: publicPathResolved, NAME: name }),
|
|
312
|
-
new CleanTerminalPlugin(
|
|
311
|
+
new CleanTerminalPlugin(),
|
|
313
312
|
// !isBuild && new ReactRefreshWebpackPlugin({ overlay: false }),
|
|
314
313
|
].filter(Boolean),
|
|
315
314
|
resolve: {
|
|
@@ -358,6 +357,19 @@ class InterpolateHtmlPlugin {
|
|
|
358
357
|
}
|
|
359
358
|
}
|
|
360
359
|
|
|
360
|
+
class CleanTerminalPlugin {
|
|
361
|
+
// Clears the terminal on watch rebuilds, skipping the first build (from boycce/clean-terminal-webpack-plugin, MIT)
|
|
362
|
+
firstRun = true
|
|
363
|
+
apply(compiler) {
|
|
364
|
+
compiler.hooks.afterCompile.tap('CleanTerminalPlugin', () => {
|
|
365
|
+
if (!this.firstRun && compiler.watchMode) process.stdout.write('\x1B[2J\x1B[3J\x1B[H')
|
|
366
|
+
})
|
|
367
|
+
compiler.hooks.done.tap('CleanTerminalPlugin', () => {
|
|
368
|
+
this.firstRun = false
|
|
369
|
+
})
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
361
373
|
function getPublicPath(env, homepage, publicPath) {
|
|
362
374
|
/**
|
|
363
375
|
* Returns public path used for webpack, used in the relative asset paths
|