@packmule/javascript-pack
Advanced tools
Comparing version 2.0.1-nightly.563 to 2.0.1-nightly.565
@@ -1,56 +0,56 @@ | ||
"use strict"; | ||
import micromatch from "micromatch"; | ||
import browserslist from "browserslist-to-esbuild"; | ||
import formatter from "eslint-formatter-pretty"; | ||
import LintPlugin from "eslint-webpack-plugin"; | ||
import micromatch from 'micromatch'; | ||
import browserslist from 'browserslist-to-esbuild'; | ||
import formatter from 'eslint-formatter-pretty'; | ||
import LintPlugin from 'eslint-webpack-plugin'; | ||
export default class JavaScriptPack { | ||
constructor() { | ||
this.defaults = { | ||
include: () => true | ||
}; | ||
this.configuration = { | ||
resolve: { | ||
extensions: [".js"] | ||
}, | ||
module: { | ||
rules: [] | ||
}, | ||
plugins: [] | ||
}; | ||
this.options = this.defaults; | ||
} | ||
include(include) { | ||
this.options.include = typeof include === "string" ? micromatch.makeRe(include, { dot: true }) : include; | ||
return this; | ||
} | ||
generate(options, hints) { | ||
const rule = { | ||
test: /\.js$/, | ||
include: this.options.include, | ||
use: [] | ||
}; | ||
const compilation = { | ||
loader: "esbuild-loader", | ||
options: { | ||
loader: "js", | ||
target: browserslist() | ||
} | ||
}; | ||
if (Array.isArray(rule.use)) { | ||
rule.use.push(compilation); | ||
constructor() { | ||
this.defaults = { | ||
include: () => true, | ||
}; | ||
this.configuration = { | ||
resolve: { | ||
extensions: ['.js'], | ||
}, | ||
module: { | ||
rules: [], | ||
}, | ||
plugins: [], | ||
}; | ||
this.options = this.defaults; | ||
} | ||
this.configuration.module.rules.push(rule); | ||
if (hints.lint) { | ||
const lint = new LintPlugin({ | ||
context: options.root, | ||
extensions: [".js"], | ||
cache: hints.cache, | ||
fix: hints.fix, | ||
lintDirtyModulesOnly: hints.watch, | ||
formatter | ||
}); | ||
this.configuration.plugins.push(lint); | ||
include(include) { | ||
this.options.include = typeof include === 'string' ? micromatch.makeRe(include, { dot: true }) : include; | ||
return this; | ||
} | ||
return this.configuration; | ||
} | ||
generate(options, hints) { | ||
const rule = { | ||
test: /\.js$/, | ||
include: this.options.include, | ||
use: [], | ||
}; | ||
const compilation = { | ||
loader: 'esbuild-loader', | ||
options: { | ||
loader: 'js', | ||
target: browserslist(), | ||
}, | ||
}; | ||
if (Array.isArray(rule.use)) { | ||
rule.use.push(compilation); | ||
} | ||
this.configuration.module.rules.push(rule); | ||
if (hints.lint) { | ||
const lint = new LintPlugin({ | ||
context: options.root, | ||
extensions: ['.js'], | ||
cache: hints.cache, | ||
fix: hints.fix, | ||
lintDirtyModulesOnly: hints.watch, | ||
formatter: formatter, | ||
}); | ||
this.configuration.plugins.push(lint); | ||
} | ||
return this.configuration; | ||
} | ||
} | ||
//# sourceMappingURL=pack.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
export { default, default as JavascriptPack } from "./common/pack.js"; | ||
export { default, default as JavascriptPack } from './common/pack.js'; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@packmule/javascript-pack", | ||
"description": "Packmule pack to process JavaScript files.", | ||
"version": "2.0.1-nightly.563+a822c97", | ||
"version": "2.0.1-nightly.565+b03cd18", | ||
"license": "MIT", | ||
@@ -25,3 +25,3 @@ "repository": "github:packmule/packmule", | ||
"scripts": { | ||
"build": "esbuild src/index.ts src/**/*.ts --platform=node --target=node14.13 --outdir=module/" | ||
"build": "tsc" | ||
}, | ||
@@ -42,9 +42,7 @@ "files": [ | ||
"devDependencies": { | ||
"@packmule/core": "^2.0.1-nightly.563+a822c97", | ||
"@types/micromatch": "^4.0.0", | ||
"esbuild": "^0.15.14", | ||
"webpack": "^5.73.0" | ||
"@packmule/core": "^2.0.1-nightly.565+b03cd18", | ||
"@types/micromatch": "^4.0.0" | ||
}, | ||
"peerDependencies": { | ||
"@packmule/core": "workspace:^" | ||
"@packmule/core": "*" | ||
}, | ||
@@ -54,3 +52,3 @@ "optionalDependencies": { | ||
}, | ||
"gitHead": "a822c970bffe5ccfec4bbc4f67161629b70d62ce" | ||
"gitHead": "b03cd18925734c2a12140b03e6de42ae25b2e613" | ||
} |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
8792
2
11
67