Skip to content

chore: remove webpack-sources #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module.exports = {
},
extends: [
'eslint:recommended',
'plugin:digital-creative/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
Expand Down
11,219 changes: 6,383 additions & 4,836 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"@typescript-eslint/parser": "^5.13.0",
"eslint": "^8.10.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-digital-creative": "github:dcasia/digital-creative-eslint-plugin",
"eslint-plugin-import": "^2.25.4",
"jest": "^27.5.1",
"rollup": "^2.68.0",
Expand All @@ -82,7 +81,6 @@
"@babel/core": "^7.17.5",
"@vivaxy/wxml": "^2.1.0",
"postcss": "^8.4.7",
"webpack-sources": "^1.4.3",
"windicss-webpack-plugin": "^1.7.2"
}
}
}
2 changes: 0 additions & 2 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export default defineConfig([
'./universal-handler',
'@babel/core',
'@vivaxy/wxml',
'webpack-sources',
],
plugins: [
typescript(
Expand All @@ -32,7 +31,6 @@ export default defineConfig([
'@tarojs/service',
'@babel/core',
'@vivaxy/wxml',
'webpack-sources',
'windicss-webpack-plugin',
],
plugins: [
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Compiler, WebpackPluginInstance } from 'webpack'
import { Compiler, WebpackPluginInstance, sources } from 'webpack'
import { Options } from './interfaces'
import { handleSource } from './universal-handler'
import { isStyleFile, isTemplateFile } from './utilities'
import { FileType } from './enum'
import { ConcatSource } from 'webpack-sources'

const { ConcatSource } = sources

export default class MiniProgramTailwindWebpackPlugin implements WebpackPluginInstance {

Expand All @@ -26,8 +27,7 @@ export default class MiniProgramTailwindWebpackPlugin implements WebpackPluginIn
if (isWebpackV5) {

const { webpack } = compiler
const { sources, Compilation } = webpack
const { ConcatSource } = sources
const { Compilation } = webpack

compiler.hooks.thisCompilation.tap(
MiniProgramTailwindWebpackPlugin.pluginName,
Expand Down
8 changes: 4 additions & 4 deletions src/taro/webpack-plugin.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { TaroWebpackPluginOptions } from '../interfaces'
import { Compiler, WebpackPluginInstance } from 'webpack'
import { Compiler, WebpackPluginInstance, sources } from 'webpack'
import { collectRawAndModified } from '../babel'
import { ConcatSource } from 'webpack-sources'
import { TaroFramework } from '../enum'
import { regExpJS } from '../utilities'

const { ConcatSource } = sources

const frameworkModuleCharacteristics = {
[ TaroFramework.React ]: [ '.jsx', '.tsx' ],
[ TaroFramework.Vue2 ]: [ 'type=template' ],
Expand Down Expand Up @@ -81,8 +82,7 @@ export default class TaroVNodeTailwindWebpackPlugin implements WebpackPluginInst
if (isWebpackV5) {

const { webpack } = compiler
const { sources, Compilation } = webpack
const { ConcatSource } = sources
const { Compilation } = webpack

compilation.hooks.processAssets.tap(
{
Expand Down