@umijs/bundler-webpack 4.0.0-beta.5 → 4.0.0-beta.9

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.
@@ -1 +1 @@
1
- {"name":"@svgr/webpack","author":"Greg Bergé <berge.greg@gmail.com>","license":"MIT"}
1
+ {"name":"@svgr/webpack","author":"Greg Bergé <berge.greg@gmail.com>","license":"MIT","typings":"./dist/index.d.ts"}
package/dist/build.d.ts CHANGED
@@ -6,6 +6,7 @@ interface IOpts {
6
6
  onBuildComplete?: Function;
7
7
  babelPreset?: any;
8
8
  chainWebpack?: Function;
9
+ modifyWebpackConfig?: Function;
9
10
  beforeBabelPlugins?: any[];
10
11
  beforeBabelPresets?: any[];
11
12
  extraBabelPlugins?: any[];
package/dist/build.js CHANGED
@@ -35,6 +35,7 @@ function build(opts) {
35
35
  ...(opts.extraBabelPresets || []),
36
36
  ],
37
37
  chainWebpack: opts.chainWebpack,
38
+ modifyWebpackConfig: opts.modifyWebpackConfig,
38
39
  });
39
40
  let isFirstCompile = true;
40
41
  return new Promise((resolve, reject) => {
package/dist/cli.js CHANGED
@@ -1,23 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -36,7 +17,6 @@ const utils_1 = require("@umijs/utils");
36
17
  const assert_1 = __importDefault(require("assert"));
37
18
  const fs_1 = require("fs");
38
19
  const path_1 = require("path");
39
- const process = __importStar(require("process"));
40
20
  const build_1 = require("./build");
41
21
  const dev_1 = require("./dev");
42
22
  const args = (0, utils_1.yParser)(process.argv.slice(2), {});
@@ -40,6 +40,18 @@ function addAssetRules(opts) {
40
40
  .generator({
41
41
  filename: `${opts.staticPathPrefix}[name].[hash:8].[ext]`,
42
42
  });
43
+ rule
44
+ .oneOf('svg')
45
+ .type('asset')
46
+ .resourceQuery(/url/)
47
+ .parser({
48
+ dataUrlCondition: {
49
+ maxSize: 1000,
50
+ },
51
+ })
52
+ .generator({
53
+ filename: `${opts.staticPathPrefix}[name].[hash:8].[ext]`,
54
+ });
43
55
  rule
44
56
  .oneOf('fallback')
45
57
  .exclude.add(/^$/) /* handle data: resources */
@@ -8,6 +8,7 @@ interface IOpts {
8
8
  extraBabelPlugins?: any[];
9
9
  babelPreset?: any;
10
10
  chainWebpack?: Function;
11
+ modifyWebpackConfig?: Function;
11
12
  hash?: boolean;
12
13
  hmr?: boolean;
13
14
  staticPathPrefix?: string;
@@ -81,7 +81,7 @@ function getConfig(opts) {
81
81
  .path(absOutputPath)
82
82
  .filename(useHash ? `[name].[contenthash:8].js` : `[name].js`)
83
83
  .chunkFilename(useHash ? `[name].[contenthash:8].async.js` : `[name].js`)
84
- .publicPath(userConfig.publicPath || '/')
84
+ .publicPath(userConfig.publicPath || 'auto')
85
85
  .pathinfo(isDev || disableCompress);
86
86
  // resolve
87
87
  // prettier-ignore
@@ -111,6 +111,7 @@ function getConfig(opts) {
111
111
  // experiments
112
112
  config.experiments({
113
113
  topLevelAwait: true,
114
+ outputModule: !!userConfig.esm,
114
115
  });
115
116
  // node polyfill
116
117
  yield (0, nodePolyfill_1.addNodePolyfill)(applyOpts);
@@ -165,6 +166,12 @@ function getConfig(opts) {
165
166
  webpackConfig = yield (0, speedMeasureWebpackPlugin_1.addSpeedMeasureWebpackPlugin)({
166
167
  webpackConfig,
167
168
  });
169
+ if (opts.modifyWebpackConfig) {
170
+ webpackConfig = yield opts.modifyWebpackConfig(webpackConfig, {
171
+ env: opts.env,
172
+ webpack: webpack_1.default,
173
+ });
174
+ }
168
175
  return webpackConfig;
169
176
  });
170
177
  }
@@ -8,17 +8,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  exports.addJavaScriptRules = void 0;
13
16
  const utils_1 = require("@umijs/utils");
14
17
  const constants_1 = require("../constants");
18
+ const autoCSSModules_1 = __importDefault(require("../swcPlugins/autoCSSModules"));
15
19
  const types_1 = require("../types");
16
20
  const depMatch_1 = require("../utils/depMatch");
17
21
  function addJavaScriptRules(opts) {
18
22
  return __awaiter(this, void 0, void 0, function* () {
19
23
  const { config, userConfig, cwd, env, name } = opts;
20
24
  const isDev = opts.env === types_1.Env.development;
21
- const useFastRefresh = isDev && userConfig.fastRefresh !== false && name === constants_1.MFSU_NAME;
25
+ const useFastRefresh = isDev && userConfig.fastRefresh !== false && name !== constants_1.MFSU_NAME;
22
26
  const depPkgs = Object.assign({}, (0, depMatch_1.es5ImcompatibleVersionsToPkg)());
23
27
  const srcRules = [
24
28
  config.module
@@ -130,6 +134,7 @@ function addJavaScriptRules(opts) {
130
134
  },
131
135
  },
132
136
  },
137
+ plugin: (m) => new autoCSSModules_1.default().visitProgram(m),
133
138
  });
134
139
  }
135
140
  else {
@@ -13,28 +13,15 @@ exports.addSVGRules = void 0;
13
13
  function addSVGRules(opts) {
14
14
  return __awaiter(this, void 0, void 0, function* () {
15
15
  const { config, userConfig } = opts;
16
- const { svgr, svgo } = userConfig;
16
+ const { svgr, svgo = {} } = userConfig;
17
17
  if (svgr) {
18
- // https://react-svgr.com/docs/webpack/#handle-svg-in-css-sass-or-less
19
- // https://github.com/gregberge/svgr/issues/551#issuecomment-883073902
20
- // https://github.com/webpack/webpack/issues/9309
21
18
  const svgrRule = config.module.rule('svgr');
22
19
  svgrRule
23
- .test(/\.svg$/)
20
+ .test(/\.svg$/i)
24
21
  .issuer(/\.[jt]sx?$/)
25
- .type('javascript/auto')
26
- .use('babel-loader')
27
- .loader(require.resolve('@umijs/bundler-webpack/compiled/babel-loader'))
28
- .end()
29
22
  .use('svgr-loader')
30
23
  .loader(require.resolve('@umijs/bundler-webpack/compiled/@svgr/webpack'))
31
- .options(Object.assign(Object.assign({ svgoConfig: {
32
- plugins: [{ removeViewBox: false }],
33
- } }, svgr), { svgo }))
34
- .end()
35
- .use('url-loader')
36
- .loader(require.resolve('@umijs/bundler-webpack/compiled/url-loader'))
37
- .end();
24
+ .options(Object.assign(Object.assign({ svgoConfig: Object.assign({}, (svgo || {})) }, svgr), { svgo: !!svgo }));
38
25
  }
39
26
  if (svgo === false) {
40
27
  const svgRule = config.module.rule('svg');
package/dist/dev.d.ts CHANGED
@@ -6,6 +6,7 @@ interface IOpts {
6
6
  port?: number;
7
7
  host?: string;
8
8
  chainWebpack?: Function;
9
+ modifyWebpackConfig?: Function;
9
10
  beforeBabelPlugins?: any[];
10
11
  beforeBabelPresets?: any[];
11
12
  extraBabelPlugins?: any[];
package/dist/dev.js CHANGED
@@ -21,10 +21,16 @@ const server_1 = require("./server/server");
21
21
  const types_1 = require("./types");
22
22
  function dev(opts) {
23
23
  var _a;
24
+ var _b;
24
25
  return __awaiter(this, void 0, void 0, function* () {
25
- const mfsu = new mfsu_1.MFSU({
26
- implementor: webpack_1.default,
27
- });
26
+ const enableMFSU = opts.config.mfsu !== false;
27
+ let mfsu = null;
28
+ if (enableMFSU) {
29
+ mfsu = new mfsu_1.MFSU({
30
+ implementor: webpack_1.default,
31
+ buildDepWithESBuild: (_a = opts.config.mfsu) === null || _a === void 0 ? void 0 : _a.esbuild,
32
+ });
33
+ }
28
34
  const webpackConfig = yield (0, config_1.getConfig)({
29
35
  cwd: opts.cwd,
30
36
  env: types_1.Env.development,
@@ -32,7 +38,7 @@ function dev(opts) {
32
38
  userConfig: opts.config,
33
39
  extraBabelPlugins: [
34
40
  ...(opts.beforeBabelPlugins || []),
35
- ...mfsu.getBabelPlugins(),
41
+ ...((mfsu === null || mfsu === void 0 ? void 0 : mfsu.getBabelPlugins()) || []),
36
42
  ...(opts.extraBabelPlugins || []),
37
43
  ],
38
44
  extraBabelPresets: [
@@ -40,6 +46,7 @@ function dev(opts) {
40
46
  ...(opts.extraBabelPresets || []),
41
47
  ],
42
48
  chainWebpack: opts.chainWebpack,
49
+ modifyWebpackConfig: opts.modifyWebpackConfig,
43
50
  hmr: true,
44
51
  analyze: process.env.ANALYZE,
45
52
  });
@@ -52,13 +59,13 @@ function dev(opts) {
52
59
  staticPathPrefix: mfsu_1.MF_DEP_PREFIX,
53
60
  name: constants_1.MFSU_NAME,
54
61
  });
55
- (_a = webpackConfig.resolve).alias || (_a.alias = {});
62
+ (_b = webpackConfig.resolve).alias || (_b.alias = {});
56
63
  // TODO: REMOVE ME
57
64
  ['@umijs/utils/compiled/strip-ansi', 'react-error-overlay'].forEach((dep) => {
58
65
  // @ts-ignore
59
66
  webpackConfig.resolve.alias[dep] = require.resolve(dep);
60
67
  });
61
- mfsu.setWebpackConfig({
68
+ mfsu === null || mfsu === void 0 ? void 0 : mfsu.setWebpackConfig({
62
69
  config: webpackConfig,
63
70
  depConfig: depConfig,
64
71
  });
@@ -67,7 +74,7 @@ function dev(opts) {
67
74
  userConfig: opts.config,
68
75
  cwd: opts.cwd,
69
76
  beforeMiddlewares: [
70
- ...mfsu.getMiddlewares(),
77
+ ...((mfsu === null || mfsu === void 0 ? void 0 : mfsu.getMiddlewares()) || []),
71
78
  ...(opts.beforeMiddlewares || []),
72
79
  ],
73
80
  port: opts.port,
package/dist/schema.js CHANGED
@@ -50,7 +50,9 @@ function getSchemas() {
50
50
  jsMinifier: (Joi) => Joi.string().valid(types_1.JSMinifier.esbuild, types_1.JSMinifier.swc, types_1.JSMinifier.terser, types_1.JSMinifier.uglifyJs, types_1.JSMinifier.none),
51
51
  jsMinifierOptions: (Joi) => Joi.object(),
52
52
  lessLoader: (Joi) => Joi.object(),
53
- mfsu: (Joi) => Joi.alternatives(Joi.object(), Joi.boolean()),
53
+ mfsu: (Joi) => Joi.alternatives(Joi.object({
54
+ esbuild: Joi.boolean(),
55
+ }), Joi.boolean()),
54
56
  outputPath: (Joi) => Joi.string(),
55
57
  postcssLoader: (Joi) => Joi.object(),
56
58
  proxy: (Joi) => Joi.object(),
@@ -63,6 +65,8 @@ function getSchemas() {
63
65
  svgo: (Joi) => Joi.alternatives().try(Joi.object(), Joi.boolean()),
64
66
  targets: (Joi) => Joi.object(),
65
67
  writeToDisk: (Joi) => Joi.boolean(),
68
+ esm: (Joi) => Joi.object(),
69
+ theme: (Joi) => Joi.object(),
66
70
  };
67
71
  }
68
72
  exports.getSchemas = getSchemas;
@@ -32,6 +32,16 @@ function createServer(opts) {
32
32
  // TODO: headers
33
33
  // before middlewares
34
34
  (opts.beforeMiddlewares || []).forEach((m) => app.use(m));
35
+ // TODO: add to before middleware
36
+ app.use((req, res, next) => {
37
+ if (req.path === '/umi.js' && (0, fs_1.existsSync)((0, path_1.join)(opts.cwd, 'umi.js'))) {
38
+ res.setHeader('Content-Type', 'application/javascript');
39
+ res.send((0, fs_1.readFileSync)((0, path_1.join)(opts.cwd, 'umi.js'), 'utf-8'));
40
+ }
41
+ else {
42
+ next();
43
+ }
44
+ });
35
45
  // webpack dev middleware
36
46
  const compiler = (0, webpack_1.default)(Array.isArray(webpackConfig) ? webpackConfig : [webpackConfig]);
37
47
  const webpackDevMiddleware = require('@umijs/bundler-webpack/compiled/webpack-dev-middleware');
@@ -117,15 +127,6 @@ function createServer(opts) {
117
127
  app.use('/__umi_ping', (_, res) => {
118
128
  res.end('pong');
119
129
  });
120
- // TODO: remove me
121
- app.use((req, res, next) => {
122
- if (req.path === '/umi.js' && (0, fs_1.existsSync)((0, path_1.join)(opts.cwd, 'umi.js'))) {
123
- res.send((0, fs_1.readFileSync)((0, path_1.join)(opts.cwd, 'umi.js'), 'utf-8'));
124
- }
125
- else {
126
- next();
127
- }
128
- });
129
130
  // index.html
130
131
  // TODO: remove me
131
132
  app.get('/', (_req, res, next) => {
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { Server } from 'http';
3
- import WebSocket from 'ws';
3
+ import WebSocket from '../../compiled/ws';
4
4
  export declare function createWebSocketServer(server: Server): {
5
5
  send(message: string): void;
6
6
  wss: WebSocket.Server;
package/dist/server/ws.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createWebSocketServer = void 0;
7
7
  const utils_1 = require("@umijs/utils");
8
- const ws_1 = __importDefault(require("ws"));
8
+ const ws_1 = __importDefault(require("../../compiled/ws"));
9
9
  function createWebSocketServer(server) {
10
10
  const wss = new ws_1.default.Server({
11
11
  noServer: true,
@@ -0,0 +1,8 @@
1
+ import { ImportDeclaration, TsType, VariableDeclaration } from '@swc/core';
2
+ import Visitor from '@swc/core/Visitor';
3
+ declare class AutoCSSModule extends Visitor {
4
+ visitTsType(expression: TsType): TsType;
5
+ visitImportDeclaration(expression: ImportDeclaration): ImportDeclaration;
6
+ visitVariableDeclaration(expression: VariableDeclaration): VariableDeclaration;
7
+ }
8
+ export default AutoCSSModule;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Visitor_1 = __importDefault(require("@swc/core/Visitor"));
7
+ const path_1 = require("path");
8
+ const CSS_EXT_NAMES = ['.css', '.less', '.sass', '.scss', '.stylus', '.styl'];
9
+ class AutoCSSModule extends Visitor_1.default {
10
+ visitTsType(expression) {
11
+ return expression;
12
+ }
13
+ visitImportDeclaration(expression) {
14
+ const { specifiers, source } = expression;
15
+ const { value } = source;
16
+ if (specifiers.length && CSS_EXT_NAMES.includes((0, path_1.extname)(value))) {
17
+ return Object.assign(Object.assign({}, expression), { source: Object.assign(Object.assign({}, source), { value: `${value}?modules` }) });
18
+ }
19
+ return expression;
20
+ }
21
+ visitVariableDeclaration(expression) {
22
+ const { declarations } = expression;
23
+ if (declarations.length &&
24
+ declarations[0].init &&
25
+ declarations[0].init.type === 'AwaitExpression' &&
26
+ declarations[0].init.argument.type === 'CallExpression' &&
27
+ declarations[0].init.argument.arguments[0].expression.type ===
28
+ 'StringLiteral' &&
29
+ CSS_EXT_NAMES.includes((0, path_1.extname)(declarations[0].init.argument.arguments[0].expression.value))) {
30
+ declarations[0].init.argument.arguments[0].expression.value = `${declarations[0].init.argument.arguments[0].expression.value}?modules`;
31
+ }
32
+ return expression;
33
+ }
34
+ }
35
+ exports.default = AutoCSSModule;
package/dist/types.d.ts CHANGED
@@ -52,6 +52,9 @@ export interface IConfig {
52
52
  depTranspiler?: Transpiler;
53
53
  devtool?: Config.DevTool;
54
54
  externals?: WebpackConfig['externals'];
55
+ esm?: {
56
+ [key: string]: any;
57
+ };
55
58
  extraBabelPlugins?: IBabelPlugin[];
56
59
  extraBabelPresets?: IBabelPlugin[];
57
60
  extraPostCSSPlugins?: any[];
package/package.json CHANGED
@@ -1,9 +1,19 @@
1
1
  {
2
2
  "name": "@umijs/bundler-webpack",
3
- "version": "4.0.0-beta.5",
3
+ "version": "4.0.0-beta.9",
4
4
  "description": "@umijs/bundler-webpack",
5
+ "homepage": "https://github.com/umijs/umi-next/tree/master/packages/bundler-webpack#readme",
6
+ "bugs": "https://github.com/umijs/umi-next/issues",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/umijs/umi-next"
10
+ },
11
+ "license": "MIT",
5
12
  "main": "dist/index.js",
6
13
  "types": "dist/index.d.ts",
14
+ "bin": {
15
+ "bundler-webpack": "bin/bundler-webpack.js"
16
+ },
7
17
  "files": [
8
18
  "bin",
9
19
  "client",
@@ -17,29 +27,13 @@
17
27
  "dev": "pnpm build -- --watch",
18
28
  "generate:webpackPackages": "zx ./scripts/generateWebpackPackages.mjs"
19
29
  },
20
- "repository": {
21
- "type": "git",
22
- "url": "https://github.com/umijs/umi-next"
23
- },
24
- "authors": [
25
- "chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
26
- ],
27
- "license": "MIT",
28
- "bugs": "https://github.com/umijs/umi-next/issues",
29
- "homepage": "https://github.com/umijs/umi-next/tree/master/packages/bundler-webpack#readme",
30
- "publishConfig": {
31
- "access": "public"
32
- },
33
- "bin": {
34
- "bundler-webpack": "bin/bundler-webpack.js"
35
- },
36
30
  "dependencies": {
37
31
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.1",
38
32
  "@swc/core": "1.2.105",
39
33
  "@types/hapi__joi": "17.1.7",
40
- "@umijs/babel-preset-umi": "4.0.0-beta.5",
41
- "@umijs/mfsu": "4.0.0-beta.5",
42
- "@umijs/utils": "4.0.0-beta.5",
34
+ "@umijs/babel-preset-umi": "4.0.0-beta.9",
35
+ "@umijs/mfsu": "4.0.0-beta.9",
36
+ "@umijs/utils": "4.0.0-beta.9",
43
37
  "css-loader": "6.5.0",
44
38
  "es5-imcompatible-versions": "^0.1.73",
45
39
  "jest-worker": "27.3.1",
@@ -49,7 +43,7 @@
49
43
  "react-error-overlay": "6.0.9"
50
44
  },
51
45
  "devDependencies": {
52
- "@svgr/webpack": "5.5.0",
46
+ "@svgr/webpack": "6.0.0",
53
47
  "@types/express": "4.17.13",
54
48
  "@types/webpack-sources": "3.2.0",
55
49
  "@types/ws": "8.2.0",
@@ -86,6 +80,12 @@
86
80
  "webpack-sources": "3.2.1",
87
81
  "ws": "8.2.3"
88
82
  },
83
+ "publishConfig": {
84
+ "access": "public"
85
+ },
86
+ "authors": [
87
+ "chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
88
+ ],
89
89
  "compiledConfig": {
90
90
  "deps": [
91
91
  "@svgr/webpack",
@@ -1,75 +0,0 @@
1
- # replace default config
2
-
3
- # multipass: true
4
- # full: true
5
-
6
- plugins:
7
-
8
- # - name
9
- #
10
- # or:
11
- # - name: false
12
- # - name: true
13
- #
14
- # or:
15
- # - name:
16
- # param1: 1
17
- # param2: 2
18
-
19
- - removeDoctype
20
- - removeXMLProcInst
21
- - removeComments
22
- - removeMetadata
23
- - removeXMLNS
24
- - removeEditorsNSData
25
- - cleanupAttrs
26
- - inlineStyles
27
- - minifyStyles
28
- - convertStyleToAttrs
29
- - cleanupIDs
30
- - prefixIds
31
- - removeRasterImages
32
- - removeUselessDefs
33
- - cleanupNumericValues
34
- - cleanupListOfValues
35
- - convertColors
36
- - removeUnknownsAndDefaults
37
- - removeNonInheritableGroupAttrs
38
- - removeUselessStrokeAndFill
39
- - removeViewBox
40
- - cleanupEnableBackground
41
- - removeHiddenElems
42
- - removeEmptyText
43
- - convertShapeToPath
44
- - convertEllipseToCircle
45
- - moveElemsAttrsToGroup
46
- - moveGroupAttrsToElems
47
- - collapseGroups
48
- - convertPathData
49
- - convertTransform
50
- - removeEmptyAttrs
51
- - removeEmptyContainers
52
- - mergePaths
53
- - removeUnusedNS
54
- - sortAttrs
55
- - sortDefsChildren
56
- - removeTitle
57
- - removeDesc
58
- - removeDimensions
59
- - removeAttrs
60
- - removeAttributesBySelector
61
- - removeElementsByAttr
62
- - addClassesToSVGElement
63
- - removeStyleElement
64
- - removeScriptElement
65
- - addAttributesToSVGElement
66
- - removeOffCanvasPaths
67
- - reusePaths
68
-
69
- # configure the indent (default 4 spaces) used by `--pretty` here:
70
- #
71
- # @see https://github.com/svg/svgo/blob/master/lib/svgo/js2svg.js#L6 for more config options
72
- #
73
- # js2svg:
74
- # pretty: true
75
- # indent: ' '