This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import path from 'path'; | |
import fs from 'fs'; | |
import { generate } from 'astring' | |
interface Options { | |
test: RegExp; | |
include: string[]; | |
dir: string; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const { RawSource } = require('webpack').sources; | |
const PLUGIN_NAME = 'DevSourcemapWebpackPlugin'; | |
class DevSourcemapWebpackPlugin { | |
constructor(options) { | |
this.test = options.test || new RegExp(`${PLUGIN_NAME}__no_source_map_reg__`); | |
} | |
apply(compiler) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { RawSource, CachedSource } = require('webpack').sources; | |
const Compilation = require('webpack').Compilation; | |
const PLUGIN_NAME = 'AsyncJsonpWebpackPlugin'; | |
/** | |
* modify webpack output to async jsonp | |
* | |
* before: | |
* (() => { | |
* // sync code run |