mirror of
https://github.com/hanzoai/workbox.git
synced 2026-09-24 17:04:35 +00:00
Revert "replace to 1st place in plugins"
This reverts commit face0e67e9.
This commit is contained in:
@@ -23,21 +23,7 @@ module.exports = {
|
||||
// plugin set up and used to ensure as consist set of tests
|
||||
// as possible.
|
||||
getDefaultPlugins: (buildType, buildFormat = 'iife', es5 = false) => {
|
||||
const plugins = [];
|
||||
|
||||
// This is what the build should be
|
||||
const replaceOptions = {
|
||||
preventAssignment: true,
|
||||
WORKBOX_CDN_ROOT_URL: getVersionsCDNUrl(),
|
||||
};
|
||||
|
||||
if (buildType) {
|
||||
replaceOptions['process.env.NODE_ENV'] = JSON.stringify(buildType);
|
||||
}
|
||||
|
||||
// Replace allows us to input NODE_ENV and strip code accordingly
|
||||
plugins.push(replace(replaceOptions));
|
||||
plugins.push(nodeResolve());
|
||||
const plugins = [nodeResolve()];
|
||||
|
||||
const babelConfig = {
|
||||
babelHelpers: 'bundled',
|
||||
@@ -95,6 +81,19 @@ module.exports = {
|
||||
plugins.push(terserPlugin(terserOptions));
|
||||
}
|
||||
|
||||
// This is what the build should be
|
||||
const replaceOptions = {
|
||||
preventAssignment: true,
|
||||
WORKBOX_CDN_ROOT_URL: getVersionsCDNUrl(),
|
||||
};
|
||||
|
||||
if (buildType) {
|
||||
replaceOptions['process.env.NODE_ENV'] = JSON.stringify(buildType);
|
||||
}
|
||||
|
||||
// Replace allows us to input NODE_ENV and strip code accordingly
|
||||
plugins.push(replace(replaceOptions));
|
||||
|
||||
return plugins;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -39,12 +39,6 @@ async function handler(req, res) {
|
||||
const bundle = await rollup({
|
||||
input: `./test/${packageName}/sw/` + testFilter,
|
||||
plugins: [
|
||||
replace({
|
||||
'preventAssignment': true,
|
||||
'process.env.NODE_ENV': JSON.stringify(env),
|
||||
'SW_NAMESPACES': JSON.stringify(SW_NAMESPACES),
|
||||
'WORKBOX_CDN_ROOT_URL': '/__WORKBOX/buildFile',
|
||||
}),
|
||||
multiEntry(),
|
||||
nodeResolve({
|
||||
moduleDirectories: ['packages', 'node_modules'],
|
||||
@@ -54,6 +48,12 @@ async function handler(req, res) {
|
||||
commonjs({
|
||||
exclude: '*.mjs',
|
||||
}),
|
||||
replace({
|
||||
'preventAssignment': true,
|
||||
'process.env.NODE_ENV': JSON.stringify(env),
|
||||
'SW_NAMESPACES': JSON.stringify(SW_NAMESPACES),
|
||||
'WORKBOX_CDN_ROOT_URL': '/__WORKBOX/buildFile',
|
||||
}),
|
||||
],
|
||||
// Fail in the case of warning, so rebuilds work.
|
||||
onwarn({loc, message}) {
|
||||
|
||||
@@ -43,12 +43,12 @@ export async function bundle({
|
||||
await writeFile(temporaryFile, unbundledCode);
|
||||
|
||||
const plugins = [
|
||||
nodeResolve(),
|
||||
replace({
|
||||
// See https://github.com/GoogleChrome/workbox/issues/2769
|
||||
'preventAssignment': true,
|
||||
'process.env.NODE_ENV': JSON.stringify(mode),
|
||||
}),
|
||||
nodeResolve(),
|
||||
babel({
|
||||
babelHelpers: 'bundled',
|
||||
// Disable the logic that checks for local Babel config files:
|
||||
|
||||
Reference in New Issue
Block a user