Transform webpack config into TS

This commit is contained in:
the1812 2022-06-15 08:49:16 +08:00
parent 1c25c8233d
commit cd58a89972
42 changed files with 375 additions and 327 deletions

View File

@ -1,6 +1,6 @@
import { Watching, Configuration, webpack } from 'webpack'
import exitHook from 'async-exit-hook'
import { fromId } from '../../registry/webpack/id'
import { fromId } from '../../registry/lib/id'
import { defaultWatcherHandler } from './watcher-common'
import { sendMessage } from './web-socket-server'
import { devServerConfig } from './config'

View File

@ -17,14 +17,16 @@
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/preset-env": "^7.9.6",
"@babel/preset-typescript": "^7.9.0",
"@babel/types": "^7.18.4",
"@types/async-exit-hook": "^2.0.0",
"@types/babel__core": "^7.1.19",
"@types/color": "^3.0.1",
"@types/glob": "^7.2.0",
"@types/lodash": "^4.14.172",
"@types/marked": "^1.2.0",
"@types/node": "^17.0.31",
"@types/serve-handler": "^6.1.1",
"@types/sortablejs": "^1.10.7",
"@types/webpack": "^4.41.6",
"@types/webpack-env": "^1.15.1",
"@types/ws": "^8.2.3",
"@typescript-eslint/eslint-plugin": "^5.9.1",

View File

@ -1,6 +1,6 @@
import { ComponentMetadata } from '@/components/types'
import { DocSource, DocSourceItem } from '.'
import { getId } from '../../webpack/id'
import { getId } from '../id'
import { getThirdPartyDescription, thirdPartyComponents } from './third-party'
export const getComponentsDoc: DocSource = async rootPath => {

View File

@ -1,7 +1,7 @@
import { getDescriptionMarkdown } from '@/components/description'
import { PluginMetadata } from '@/plugins/plugin'
import { DocSource, DocSourceItem } from '.'
import { getId } from '../../webpack/id'
import { getId } from '../id'
import { getThirdPartyDescription, thirdPartyPlugins } from './third-party'
export const getPluginsDoc: DocSource = async rootPath => {

21
registry/lib/id.ts Normal file
View File

@ -0,0 +1,21 @@
/**
* Runs both in Node.js and browser (without path module).
* Paths are case-sensitive.
*/
/**
* Generate id from relative path and remove filename
* @example getId('folder1/', 'folder1/folder2/index.ts') -> 'folder2'
*/
export const getId = (root: string, entry: string) => {
const relative = entry.replace(root, '').replace(/\\/g, '/')
return relative.replace(/\/[^\/]+$/, '')
}
/**
* Reverse method for `getId`
* @example getId('folder1/', 'folder2') -> 'folder1/folder2/index.ts'
*/
export const fromId = (root: string, id: string, filename = 'index.ts') => (
`${root.replace(/\\/g, '/')}${id.replace(/\\/g, '/')}/${filename}`
)

View File

@ -1,7 +0,0 @@
const builder = require('./build')
module.exports = async () => {
return [
...(await builder.component({ buildAll: true })),
...(await builder.plugin({ buildAll: true })),
]
}

8
registry/webpack/all.ts Normal file
View File

@ -0,0 +1,8 @@
import { builders } from './build'
export default async () => {
return [
...(await builders.component({ buildAll: true })),
...(await builders.plugin({ buildAll: true })),
]
}

View File

@ -1,9 +1,9 @@
const { buildByEntry } = require('./config')
import { buildByEntry } from './config'
import glob from 'glob'
module.exports = Object.fromEntries(['component', 'plugin', 'doc'].map(type => {
export const builders = Object.fromEntries(['component', 'plugin', 'doc'].map(type => {
const src = `./registry/lib/${type}s/`
return [type, async ({ buildAll = false } = {}) => {
const glob = require('glob')
const entries = glob.sync(src + '**/index.ts')
if (buildAll) {
@ -11,7 +11,7 @@ module.exports = Object.fromEntries(['component', 'plugin', 'doc'].map(type => {
return entries.map(entry => buildByEntry({ src, type, entry }))
}
let entry
let entry: string
if (entries.length > 1) {
const { AutoComplete } = require('enquirer')
const prompt = new AutoComplete({
@ -24,6 +24,6 @@ module.exports = Object.fromEntries(['component', 'plugin', 'doc'].map(type => {
[entry] = entries
console.log(`Build target · ${entry}`)
}
return buildByEntry({ src, type, entry })
return [buildByEntry({ src, type, entry })]
}]
}))

View File

@ -1 +0,0 @@
module.exports = require('./build').component()

View File

@ -0,0 +1,3 @@
import { builders } from './build'
export default builders.component()

View File

@ -1,71 +0,0 @@
const buildByEntry = ({ src, type, entry }) => {
// const match = entry.match(/\/?registry\/dist\/([^\/]+)\/(.+)\/index\.ts/)
// if (!match) {
// throw new Error(`Invalid entry path: ${entry}`)
// }
const path = require('path')
const { getId } = require('./id')
const id = getId(src, entry)
const { getDefaultConfig } = require('../../webpack/webpack.config')
const config = Object.assign(getDefaultConfig(path.resolve('./registry/lib/')), {
mode: 'production',
entry: {
[id]: entry,
},
output: {
path: path.resolve(`./registry/dist/${type}s/`),
filename: '[name].js',
library: {
name: '[name]',
type: 'umd',
export: type,
},
},
cache: false,
})
config.externals.push(function ({ request }, callback) {
const lodash = require('lodash')
const regexMatch = (regex, base) => {
const match = request.match(regex)
if (match) {
const subModules = match[1] ? match[1].split('/').map(name => {
if (name.match(/\.vue$/)) {
return name.replace(/\.vue$/, '')
}
return lodash.camelCase(name)
}) : []
return () => callback(null, ['coreApis', ...base, ...subModules], 'root')
}
return null
}
const matches = [
{
regex: /^@\/core\/(.+)$/,
base: [],
},
{
regex: /^@\/ui$/,
base: ['ui'],
},
{
regex: /^@\/components\/(.+)$/,
base: ['componentApis'],
},
{
regex: /^@\/plugins\/(.+)$/,
base: ['pluginApis'],
},
]
for (const { regex, base } of matches) {
const matchCallback = regexMatch(regex, base)
if (matchCallback) {
return matchCallback()
}
}
return callback()
})
return config
}
module.exports = {
buildByEntry,
}

View File

@ -0,0 +1,75 @@
import { getDefaultConfig } from '../../webpack/webpack.config'
import path from 'path'
import { getId } from '../lib/id'
import { Configuration } from 'webpack'
export const buildByEntry = ({ src, type, entry }: { src: string; type: string; entry: string }) => {
// const match = entry.match(/\/?registry\/dist\/([^\/]+)\/(.+)\/index\.ts/)
// if (!match) {
// throw new Error(`Invalid entry path: ${entry}`)
// }
const id = getId(src, entry)
const defaultConfig = getDefaultConfig(path.resolve('./registry/lib/'))
const config: Configuration = {
...defaultConfig,
mode: 'production',
entry: {
[id]: entry,
},
output: {
path: path.resolve(`./registry/dist/${type}s/`),
filename: '[name].js',
library: {
name: '[name]',
type: 'umd',
export: type,
},
},
cache: false,
externals: [
...(defaultConfig.externals as any[]),
({ request }, callback) => {
const lodash = require('lodash')
const regexMatch = (regex: RegExp, base: string[]) => {
const match = request.match(regex)
if (match) {
const subModules = match[1] ? match[1].split('/').map(name => {
if (name.match(/\.vue$/)) {
return name.replace(/\.vue$/, '')
}
return lodash.camelCase(name)
}) : []
return () => (callback as any)(null, ['coreApis', ...base, ...subModules], 'root')
}
return null
}
const matches = [
{
regex: /^@\/core\/(.+)$/,
base: [],
},
{
regex: /^@\/ui$/,
base: ['ui'],
},
{
regex: /^@\/components\/(.+)$/,
base: ['componentApis'],
},
{
regex: /^@\/plugins\/(.+)$/,
base: ['pluginApis'],
},
]
for (const { regex, base } of matches) {
const matchCallback = regexMatch(regex, base)
if (matchCallback) {
return matchCallback()
}
}
return callback()
}
],
}
return config
}

View File

@ -1,6 +0,0 @@
module.exports = require('./build').doc().then(config => {
const path = require('path')
config.output.path = path.resolve(`./registry/dist/`)
config.output.filename = 'doc.js'
return config
})

10
registry/webpack/docs.ts Normal file
View File

@ -0,0 +1,10 @@
import { builders } from './build'
import path from 'path'
export default builders.doc().then(configs => {
return configs.map(config => {
config.output.path = path.resolve(`./registry/dist/`)
config.output.filename = 'doc.js'
return config
})
})

View File

@ -1,2 +0,0 @@
export const getId: (root: string, entry: string) => string
export const fromId: (root: string, id: string, filename?: string) => string

View File

@ -1,21 +0,0 @@
/**
* Runs both in Node.js and browser (without path module).
* Paths are case-sensitive.
*/
module.exports = {
/**
* Generate id from relative path and remove filename
* @example getId('folder1/', 'folder1/folder2/index.ts') -> 'folder2'
*/
getId: (root, entry) => {
const relative = entry.replace(root, '').replace(/\\/g, '/')
return relative.replace(/\/[^\/]+$/, '')
},
/**
* Reverse method for `getId`
* @example getId('folder1/', 'folder2') -> 'folder1/folder2/index.ts'
*/
fromId: (root, id, filename = 'index.ts') => {
return `${root.replace(/\\/g, '/')}${id.replace(/\\/g, '/')}/${filename}`
}
}

View File

@ -1 +0,0 @@
module.exports = require('./build').plugin()

View File

@ -0,0 +1,3 @@
import { builders } from './build'
export default builders.plugin()

View File

@ -92,3 +92,4 @@ state.settingsLoaded = true
/** 脚本当前的设置 */
export const settings: Settings = state.internalSettings
export * from './helpers'
export * from './types'

9
src/global.d.ts vendored
View File

@ -8,13 +8,15 @@ declare global {
const lodash: LoDashStatic
const Vue: typeof import('vue/types/umd')
interface CompilationInfo {
year: string
interface GitInfo {
commitHash: string
branch: string
version: string
nearestTag: string
versionWithTag: string
}
interface CompilationInfo extends GitInfo {
year: string
version: string
altCdn: {
owner: string
host: string
@ -34,6 +36,7 @@ declare global {
// buildTime: number
}
const webpackCompilationInfo: CompilationInfo
const webpackGitInfo: GitInfo
const BwpElement: {
new(): HTMLVideoElement

View File

@ -4,6 +4,7 @@
"moduleResolution": "node",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
@ -21,12 +22,19 @@
"include": [
"src/**/*",
"tests/**/*",
"registry/lib/**/*"
"registry/lib/**/*",
"webpack/**/*",
"registry/webpack/**/*"
],
"exclude": [
"node_modules",
"dev",
"packages",
"typings"
]
],
"ts-node": {
"compilerOptions": {
"module": "CommonJS"
}
}
}

View File

@ -1,8 +1,5 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"skipLibCheck": true,
},
"include": [
"src/client/bilibili-evolved.ts",
"src/**/*.d.ts",

View File

@ -1,6 +1,8 @@
import { CdnConfig } from './types'
const owner = 'the1812'
const host = 'raw.githubusercontent.com'
const github = {
export const github: CdnConfig = {
owner,
host,
stableClient: `https://${host}/${owner}/Bilibili-Evolved/master/dist/bilibili-evolved.user.js`,
@ -16,6 +18,3 @@ const github = {
logo: `https://${host}/${owner}/Bilibili-Evolved/preview/images/logo.png`,
root: (branch, ownerOverride) => `https://${host}/${ownerOverride || owner}/Bilibili-Evolved/${branch}/`,
}
module.exports = {
github,
}

View File

@ -1,5 +0,0 @@
const { github } = require('./github')
const altCdn = github
module.exports = {
altCdn,
}

3
webpack/cdn/index.ts Normal file
View File

@ -0,0 +1,3 @@
import { github } from './github'
export const altCdn = github

View File

@ -1,6 +1,8 @@
import { CdnConfig } from './types'
const owner = 'the1812'
const host = 'cdn.jsdelivr.net'
const jsdelivr = {
export const jsdelivr: CdnConfig = {
owner,
host,
stableClient: `https://${host}/gh/${owner}/Bilibili-Evolved@master/dist/bilibili-evolved.user.js`,
@ -16,6 +18,3 @@ const jsdelivr = {
logo: `https://${host}/gh/${owner}/Bilibili-Evolved@preview/images/logo.png`,
root: (branch, ownerOverride) => `https://${host}/gh/${ownerOverride || owner}/Bilibili-Evolved@${branch}/`,
}
module.exports = {
jsdelivr,
}

16
webpack/cdn/types.ts Normal file
View File

@ -0,0 +1,16 @@
export interface CdnConfig {
owner: string
host: string
stableClient: string
previewClient: string
library: {
lodash: string
protobuf: string
jszip: string
sortable: string
mdi: string
},
smallLogo: string
logo: string
root: (branch: string, ownerOverride: string) => string
}

View File

@ -1,25 +1,18 @@
const process = require('child_process')
import process from 'child_process'
const commitHash = process
export const commitHash = process
.execSync('git rev-parse HEAD')
.toString()
.trim()
const branch = process
export const branch = process
.execSync('git rev-parse --abbrev-ref HEAD')
.toString()
.trim()
const nearestTag = process
export const nearestTag = process
.execSync('git describe --abbrev=0 --tags --always')
.toString()
.trim()
const versionWithTag = process
export const versionWithTag = process
.execSync('git describe --tags --always')
.toString()
.trim()
module.exports = {
commitHash,
branch,
nearestTag,
versionWithTag,
}

View File

@ -1,9 +0,0 @@
const runtimeInfo = require('./runtime')
const compilationInfo = {
...runtimeInfo,
...webpackGitInfo,
}
module.exports = {
compilationInfo,
}

View File

@ -0,0 +1,6 @@
import { runtimeInfo } from './runtime'
export const compilationInfo = {
...runtimeInfo,
...webpackGitInfo,
}

View File

@ -1,8 +0,0 @@
const commonMeta = require('../../src/client/common.meta.json')
const { altCdn } = require('../cdn')
module.exports = {
year: new Date().getFullYear(),
version: commonMeta.version,
altCdn,
}

View File

@ -0,0 +1,8 @@
import commonMeta from '../../src/client/common.meta.json'
import { altCdn } from '../cdn'
export const runtimeInfo = {
year: new Date().getFullYear(),
version: commonMeta.version,
altCdn,
}

View File

@ -1,4 +1,4 @@
const process = require('child_process')
import process from 'child_process'
const excludePatterns = [
/^docs?\//,
@ -13,7 +13,7 @@ const excludePatterns = [
/^LICENCE$/,
]
const isSourceChanged = () => {
export const isSourceChanged = () => {
const lastDiff = process
.execSync('git diff --name-only HEAD^')
.toString()
@ -23,7 +23,3 @@ const isSourceChanged = () => {
const isAllExcluded = lastDiff.every(path => excludePatterns.some(p => p.test(path)))
return !isAllExcluded
}
module.exports = {
isSourceChanged,
}

View File

@ -1,33 +0,0 @@
const runtimeInfo = require('../compilation-info/runtime')
const gitInfo = require('../compilation-info/git')
const nodePath = require('path')
module.exports = function (babel) {
const { types } = babel
return {
visitor: {
ExportNamedDeclaration (path, state) {
const { filename } = state.file.opts
const isFromRegistry = filename.startsWith(nodePath.resolve('./registry'))
const isEntryFile = nodePath.basename(filename) === 'index.ts'
if (!(isFromRegistry && isEntryFile)) {
return
}
const { node } = path
node.declaration?.declarations?.forEach(d => {
if (!['component', 'plugin'].includes(d.id?.name)) {
return
}
const targetExpression = d.init.type === 'CallExpression' ? d.init.arguments[0] : d.init
if (targetExpression.type !== 'ObjectExpression') {
return
}
targetExpression.properties.push(...[
types.objectProperty(types.identifier('commitHash'), types.stringLiteral(gitInfo.commitHash)),
types.objectProperty(types.identifier('coreVersion'), types.stringLiteral(runtimeInfo.version)),
])
})
}
}
}
}

View File

@ -0,0 +1,53 @@
import { runtimeInfo } from '../compilation-info/runtime'
import { commitHash } from '../compilation-info/git'
import nodePath from 'path'
import { PluginObj } from '@babel/core'
import {
Identifier,
objectProperty,
identifier,
stringLiteral,
} from '@babel/types'
export const injectMetadata = (): PluginObj => {
return {
visitor: {
ExportNamedDeclaration(path, state) {
const { filename } = state.file.opts
const isFromRegistry = filename.startsWith(
nodePath.resolve('./registry'),
)
const isEntryFile = nodePath.basename(filename) === 'index.ts'
if (!(isFromRegistry && isEntryFile)) {
return
}
const { node } = path
if (node.declaration?.type !== 'VariableDeclaration') {
return
}
node.declaration.declarations?.forEach(d => {
if (!['component', 'plugin'].includes((d.id as Identifier)?.name)) {
return
}
const targetExpression =
d.init.type === 'CallExpression' ? d.init.arguments[0] : d.init
if (targetExpression.type !== 'ObjectExpression') {
return
}
targetExpression.properties.push(
...[
objectProperty(
identifier('commitHash'),
stringLiteral(commitHash),
),
objectProperty(
identifier('coreVersion'),
stringLiteral(runtimeInfo.version),
),
],
)
})
},
},
}
}

View File

@ -1,38 +0,0 @@
const postcssPresetEnv = require('postcss-preset-env')
const autoPrefixer = require('autoprefixer')
// const sass = require('sass')
const cssLoader = {
loader: 'css-loader',
options: {
esModule: false,
},
}
const postCssLoader = {
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: [
postcssPresetEnv(),
autoPrefixer(),
],
},
},
}
const sassLoader = {
loader: 'fast-sass-loader',
options: {
// implementation: sass,
// sassOptions: {
includePaths: ['src/ui/'],
// }
},
}
module.exports = {
cssLoader,
postCssLoader,
sassLoader,
cssStyleLoaders: [ cssLoader, postCssLoader ],
sassStyleLoaders: [ cssLoader, postCssLoader, sassLoader ],
}

View File

@ -0,0 +1,32 @@
import postcssPresetEnv from 'postcss-preset-env'
import autoPrefixer from 'autoprefixer'
export const cssLoader = {
loader: 'css-loader',
options: {
esModule: false,
},
}
export const postCssLoader = {
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: [
postcssPresetEnv(),
autoPrefixer(),
],
},
},
}
export const sassLoader = {
loader: 'fast-sass-loader',
options: {
// implementation: sass,
// sassOptions: {
includePaths: ['src/ui/'],
// }
},
}
export const cssStyleLoaders = [ cssLoader, postCssLoader ]
export const sassStyleLoaders = [ cssLoader, postCssLoader, sassLoader ]

View File

@ -1,4 +1,7 @@
const babelLoader = {
import { RuleSetUseItem } from 'webpack'
import { injectMetadata } from './inject-metadata'
const babelLoader: RuleSetUseItem = {
loader: 'babel-loader',
options: {
presets: [
@ -12,7 +15,8 @@ const babelLoader = {
],
plugins: [
['@babel/plugin-proposal-class-properties'],
'./webpack/loaders/inject-metadata.js',
// './webpack/loaders/inject-metadata.js',
injectMetadata,
],
},
}
@ -42,4 +46,4 @@ const babelLoader = {
// tsLoader = babelLoader
// }
module.exports = [babelLoader]
export const tsLoaders = [babelLoader]

View File

@ -1,17 +1,15 @@
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const TerserPlugin = require('terser-webpack-plugin')
const webpack = require('webpack')
const path = require('path')
const get = require('lodash/get')
const {
cssStyleLoaders, sassStyleLoaders
} = require('./loaders/style-loaders')
const tsLoader = require('./loaders/ts-loader')
const runtimeInfo = require('./compilation-info/runtime')
import VueLoaderPlugin from 'vue-loader/lib/plugin'
import TerserPlugin from 'terser-webpack-plugin'
import webpack, { Configuration } from 'webpack'
import path from 'path'
import get from 'lodash/get'
import { cssStyleLoaders, sassStyleLoaders } from './loaders/style-loaders'
import { tsLoaders } from './loaders/ts-loader'
import { runtimeInfo } from './compilation-info/runtime'
import commonMeta from '../src/client/common.meta.json'
const relativePath = p => path.join(process.cwd(), p)
const getDefaultConfig = (srcFolder) => {
const src = srcFolder || relativePath('src')
const relativePath = (p: string) => path.join(process.cwd(), p)
export const getDefaultConfig = (src = relativePath('src')): Configuration => {
return {
mode: 'development',
// devtool: 'eval-source-map',
@ -107,11 +105,12 @@ const getDefaultConfig = (srcFolder) => {
{
test: /\.tsx?$/,
use: [
...tsLoader,
...tsLoaders,
],
include: [
src,
relativePath('tests'),
relativePath('webpack'),
],
},
{
@ -152,9 +151,7 @@ const getDefaultConfig = (srcFolder) => {
}
}
const commonMeta = require('../src/client/common.meta.json')
const replaceVariables = text => {
const replaceVariables = (text: string) => {
return text.replace(/\[([^\[\]]+)\]/g, match => {
const value = get(runtimeInfo, match)
if (value !== undefined) {
@ -163,7 +160,7 @@ const replaceVariables = text => {
return match
})
}
const getBanner = meta => `// ==UserScript==\n${Object.entries(Object.assign(meta, commonMeta)).map(([key, value]) => {
export const getBanner = (meta: Record<string, string | string[]>) => `// ==UserScript==\n${Object.entries(Object.assign(meta, commonMeta)).map(([key, value]) => {
if (Array.isArray(value)) {
const lines = [...new Set(value.map(item => `// @${key.padEnd(16, ' ')}${replaceVariables(item)}`))]
return lines.join('\n')
@ -173,8 +170,3 @@ const getBanner = meta => `// ==UserScript==\n${Object.entries(Object.assign(met
// ==/UserScript==
/* eslint-disable */ /* spell-checker: disable */
// @[ You can find all source codes in GitHub repo ]`
module.exports = {
getDefaultConfig,
getBanner,
}

View File

@ -1,13 +1,14 @@
const webpack = require('webpack')
const { getBanner, getDefaultConfig } = require('./webpack.config')
const previewMeta = require('../src/client/bilibili-evolved.preview.meta.json')
import webpack from 'webpack'
import { getBanner, getDefaultConfig } from './webpack.config'
import previewMeta from '../src/client/bilibili-evolved.preview.meta.json'
import { Configuration } from 'webpack'
const previewConfig = Object.assign(getDefaultConfig(), {
entry: './src/client/bilibili-evolved.ts',
output: {
filename: 'bilibili-evolved.dev.user.js',
},
})
}) as Configuration
previewConfig.plugins.push(
new webpack.BannerPlugin({
banner: getBanner(previewMeta),
@ -15,4 +16,5 @@ previewConfig.plugins.push(
entryOnly: true,
}),
)
module.exports = previewConfig
export default previewConfig

View File

@ -1,7 +1,7 @@
const webpack = require('webpack')
const { getBanner, getDefaultConfig } = require('./webpack.config')
const mainMeta = require('../src/client/bilibili-evolved.meta.json')
import webpack, { Configuration } from 'webpack'
import { getBanner, getDefaultConfig } from './webpack.config'
import previewConfig from './webpack.dev'
import mainMeta from '../src/client/bilibili-evolved.meta.json'
const mainConfig = Object.assign(getDefaultConfig(), {
mode: 'production',
@ -9,7 +9,7 @@ const mainConfig = Object.assign(getDefaultConfig(), {
output: {
filename: 'bilibili-evolved.user.js',
},
})
}) as Configuration
mainConfig.plugins.push(
new webpack.BannerPlugin({
banner: getBanner(mainMeta),
@ -17,7 +17,6 @@ mainConfig.plugins.push(
entryOnly: true,
}),
)
const previewConfig = require('./webpack.dev')
previewConfig.output.filename = 'bilibili-evolved.preview.user.js'
previewConfig.mode = 'production'
@ -26,4 +25,5 @@ const targets = [mainConfig, previewConfig].map(config => {
config.devtool = false
return config
})
module.exports = targets
export default targets

104
yarn.lock
View File

@ -267,6 +267,11 @@
chalk "^2.0.0"
js-tokens "^4.0.0"
"@babel/parser@^7.1.0":
version "7.18.5"
resolved "https://registry.npmmirror.com/@babel/parser/-/parser-7.18.5.tgz#337062363436a893a2d22faa60be5bb37091c83c"
integrity sha512-YZWVaglMiplo7v8f1oMQ5ZPQr0vn7HPeZXxXWsxXJRjGVrzUFn9OxFQl1sb5wzfootjA/yChhW84BV+383FSOw==
"@babel/parser@^7.16.7", "@babel/parser@^7.17.9":
version "7.17.10"
resolved "https://registry.npmmirror.com/@babel/parser/-/parser-7.17.10.tgz#873b16db82a8909e0fbd7f115772f4b739f6ce78"
@ -912,6 +917,14 @@
debug "^4.1.0"
globals "^11.1.0"
"@babel/types@^7.0.0", "@babel/types@^7.18.4", "@babel/types@^7.3.0":
version "7.18.4"
resolved "https://registry.npmmirror.com/@babel/types/-/types-7.18.4.tgz#27eae9b9fd18e9dccc3f9d6ad051336f307be354"
integrity sha512-ThN1mBcMq5pG/Vm2IcBmPPfyPXbd8S02rS+OBIDENdufvqC7Z/jHPCv9IcP01277aKtDI8g/2XysBN4hA8niiw==
dependencies:
"@babel/helper-validator-identifier" "^7.16.7"
to-fast-properties "^2.0.0"
"@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.16.8", "@babel/types@^7.17.0", "@babel/types@^7.17.10", "@babel/types@^7.4.4":
version "7.17.10"
resolved "https://registry.npmmirror.com/@babel/types/-/types-7.17.10.tgz#d35d7b4467e439fcf06d195f8100e0fea7fc82c4"
@ -1177,6 +1190,39 @@
resolved "https://registry.npmmirror.com/@types/async-exit-hook/-/async-exit-hook-2.0.0.tgz#162623f74b7018ec0da99a810d2284d697230837"
integrity sha512-RNjIyjnVZdcP5a1zeIPb5c0hq2nbJc/NOCLNKUAqeCw+J5z2zMcINISn9wybCWhczHnUu3VSUFy7ZCO6ir4ZRw==
"@types/babel__core@^7.1.19":
version "7.1.19"
resolved "https://registry.npmmirror.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460"
integrity sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw==
dependencies:
"@babel/parser" "^7.1.0"
"@babel/types" "^7.0.0"
"@types/babel__generator" "*"
"@types/babel__template" "*"
"@types/babel__traverse" "*"
"@types/babel__generator@*":
version "7.6.4"
resolved "https://registry.npmmirror.com/@types/babel__generator/-/babel__generator-7.6.4.tgz#1f20ce4c5b1990b37900b63f050182d28c2439b7"
integrity sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==
dependencies:
"@babel/types" "^7.0.0"
"@types/babel__template@*":
version "7.4.1"
resolved "https://registry.npmmirror.com/@types/babel__template/-/babel__template-7.4.1.tgz#3d1a48fd9d6c0edfd56f2ff578daed48f36c8969"
integrity sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==
dependencies:
"@babel/parser" "^7.1.0"
"@babel/types" "^7.0.0"
"@types/babel__traverse@*":
version "7.17.1"
resolved "https://registry.npmmirror.com/@types/babel__traverse/-/babel__traverse-7.17.1.tgz#1a0e73e8c28c7e832656db372b779bfd2ef37314"
integrity sha512-kVzjari1s2YVi77D3w1yuvohV2idweYXMCDzqBiVNN63TcDWrIlTVOYpqVrvbbyOE/IyzBoTKF0fdnLPEORFxA==
dependencies:
"@babel/types" "^7.3.0"
"@types/color-convert@*":
version "2.0.0"
resolved "https://registry.npmmirror.com/@types/color-convert/-/color-convert-2.0.0.tgz#8f5ee6b9e863dcbee5703f5a517ffb13d3ea4e22"
@ -1217,6 +1263,14 @@
resolved "https://registry.npmmirror.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40"
integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==
"@types/glob@^7.2.0":
version "7.2.0"
resolved "https://registry.npmmirror.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb"
integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==
dependencies:
"@types/minimatch" "*"
"@types/node" "*"
"@types/html-minifier-terser@^6.0.0":
version "6.1.0"
resolved "https://registry.npmmirror.com/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz#4fc33a00c1d0c16987b1a20cf92d20614c55ac35"
@ -1247,6 +1301,11 @@
resolved "https://registry.npmmirror.com/@types/marked/-/marked-1.2.2.tgz#1f858a0e690247ecf3b2eef576f98f86e8d960d4"
integrity sha512-wLfw1hnuuDYrFz97IzJja0pdVsC0oedtS4QsKH1/inyW9qkLQbXgMUqEQT0MVtUBx3twjWeInUfjQbhBVLECXw==
"@types/minimatch@*":
version "3.0.5"
resolved "https://registry.npmmirror.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40"
integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==
"@types/node@*", "@types/node@>=13.7.0", "@types/node@^17.0.31":
version "17.0.31"
resolved "https://registry.npmmirror.com/@types/node/-/node-17.0.31.tgz#a5bb84ecfa27eec5e1c802c6bbf8139bdb163a5d"
@ -1269,49 +1328,11 @@
resolved "https://registry.npmmirror.com/@types/sortablejs/-/sortablejs-1.10.7.tgz#ab9039c85429f0516955ec6dbc0bb20139417b15"
integrity sha512-lGCwwgpj8zW/ZmaueoPVSP7nnc9t8VqVWXS+ASX3eoUUENmiazv0rlXyTRludXzuX9ALjPsMqBu85TgJNWbTOg==
"@types/source-list-map@*":
version "0.1.2"
resolved "https://registry.npmmirror.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9"
integrity sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA==
"@types/tapable@^1":
version "1.0.8"
resolved "https://registry.npmmirror.com/@types/tapable/-/tapable-1.0.8.tgz#b94a4391c85666c7b73299fd3ad79d4faa435310"
integrity sha512-ipixuVrh2OdNmauvtT51o3d8z12p6LtFW9in7U79der/kwejjdNchQC5UMn5u/KxNoM7VHHOs/l8KS8uHxhODQ==
"@types/uglify-js@*":
version "3.13.2"
resolved "https://registry.npmmirror.com/@types/uglify-js/-/uglify-js-3.13.2.tgz#1044c1713fb81cb1ceef29ad8a9ee1ce08d690ef"
integrity sha512-/xFrPIo+4zOeNGtVMbf9rUm0N+i4pDf1ynExomqtokIJmVzR3962lJ1UE+MmexMkA0cmN9oTzg5Xcbwge0Ij2Q==
dependencies:
source-map "^0.6.1"
"@types/webpack-env@^1.15.1":
version "1.16.4"
resolved "https://registry.npmmirror.com/@types/webpack-env/-/webpack-env-1.16.4.tgz#1f4969042bf76d7ef7b5914f59b3b60073f4e1f4"
integrity sha512-llS8qveOUX3wxHnSykP5hlYFFuMfJ9p5JvIyCiBgp7WTfl6K5ZcyHj8r8JsN/J6QODkAsRRCLIcTuOCu8etkUw==
"@types/webpack-sources@*":
version "3.2.0"
resolved "https://registry.npmmirror.com/@types/webpack-sources/-/webpack-sources-3.2.0.tgz#16d759ba096c289034b26553d2df1bf45248d38b"
integrity sha512-Ft7YH3lEVRQ6ls8k4Ff1oB4jN6oy/XmU6tQISKdhfh+1mR+viZFphS6WL0IrtDOzvefmJg5a0s7ZQoRXwqTEFg==
dependencies:
"@types/node" "*"
"@types/source-list-map" "*"
source-map "^0.7.3"
"@types/webpack@^4.41.6":
version "4.41.32"
resolved "https://registry.npmmirror.com/@types/webpack/-/webpack-4.41.32.tgz#a7bab03b72904070162b2f169415492209e94212"
integrity sha512-cb+0ioil/7oz5//7tZUSwbrSAN/NWHrQylz5cW8G0dWTcF/g+/dSdMlKVZspBYuMAN1+WnwHrkxiRrLcwd0Heg==
dependencies:
"@types/node" "*"
"@types/tapable" "^1"
"@types/uglify-js" "*"
"@types/webpack-sources" "*"
anymatch "^3.0.0"
source-map "^0.6.0"
"@types/ws@^8.2.3":
version "8.2.3"
resolved "https://registry.npmmirror.com/@types/ws/-/ws-8.2.3.tgz#0bca6b03ba2f41e0fab782d4a573fe284aa907ae"
@ -1667,7 +1688,7 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0:
dependencies:
color-convert "^2.0.1"
anymatch@^3.0.0, anymatch@~3.1.2:
anymatch@~3.1.2:
version "3.1.2"
resolved "https://registry.npmmirror.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==
@ -4643,11 +4664,6 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1:
resolved "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
source-map@^0.7.3:
version "0.7.3"
resolved "https://registry.npmmirror.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383"
integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==
source-map@~0.8.0-beta.0:
version "0.8.0-beta.0"
resolved "https://registry.npmmirror.com/source-map/-/source-map-0.8.0-beta.0.tgz#d4c1bb42c3f7ee925f005927ba10709e0d1d1f11"