1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-10-08 18:17:03 +02:00

remove package ext from devrelease

This commit is contained in:
Kushagra Gour
2021-04-01 14:45:32 +05:30
parent f522518868
commit f0bebb14f3
3 changed files with 20 additions and 20 deletions

View File

@@ -59,7 +59,7 @@ gulp.task('copyFiles', function () {
'src/detached-window.js', 'src/detached-window.js',
'src/icon-48.png', 'src/icon-48.png',
'src/icon-128.png', 'src/icon-128.png',
'src/manifest.json', 'src/manifest.json'
]) ])
.pipe(gulp.dest('app')), .pipe(gulp.dest('app')),
@@ -96,7 +96,7 @@ gulp.task('copyFiles', function () {
'src/FiraCode.ttf', 'src/FiraCode.ttf',
'src/FixedSys.ttf', 'src/FixedSys.ttf',
'src/Inconsolata.ttf', 'src/Inconsolata.ttf',
'src/Monoid.ttf', 'src/Monoid.ttf'
]) ])
.pipe(gulp.dest('app')) .pipe(gulp.dest('app'))
); );
@@ -123,9 +123,9 @@ gulp.task('minify', function () {
.pipe( .pipe(
cleanCSS( cleanCSS(
{ {
debug: true, debug: true
}, },
(details) => { details => {
console.log( console.log(
`${details.name}: ${details.stats.originalSize} 👉🏼 ${details.stats.minifiedSize}` `${details.name}: ${details.stats.originalSize} 👉🏼 ${details.stats.minifiedSize}`
); );
@@ -149,7 +149,7 @@ gulp.task('fixIndex', function (cb) {
'' ''
); );
fs.writeFileSync('build/index.html', contents, 'utf8'); // fs.writeFileSync('build/index.html', contents, 'utf8');
cb(); cb();
}); });
@@ -161,12 +161,12 @@ gulp.task('generate-service-worker', function (callback) {
`${rootDir}/service-worker.js`, `${rootDir}/service-worker.js`,
{ {
staticFileGlobs: [ staticFileGlobs: [
rootDir + '/**/*.{js,html,css,png,jpg,gif,svg,eot,ttf,woff}', rootDir + '/**/*.{js,html,css,png,jpg,gif,svg,eot,ttf,woff}'
], ],
stripPrefix: `${rootDir}/`, stripPrefix: `${rootDir}/`,
// has to be increased to around 2.8mb for sass.worker.js // has to be increased to around 2.8mb for sass.worker.js
maximumFileSizeToCacheInBytes: 2900000, maximumFileSizeToCacheInBytes: 2900000
}, },
callback callback
); );
@@ -185,12 +185,12 @@ gulp.task('packageExtension', function () {
gulp gulp
.src('build/bundle.*.js') .src('build/bundle.*.js')
.pipe(rename('script.js')) .pipe(rename('script.js'))
.pipe(gulp.dest('extension')), .pipe(gulp.dest('extension'))
gulp // gulp
.src('extension/**/*') // .src('extension/**/*')
.pipe(zip(`extension-${packageJson.version}.zip`)) // .pipe(zip(`extension-${packageJson.version}.zip`))
.pipe(gulp.dest('./')) // .pipe(gulp.dest('./'))
); );
}); });
@@ -218,7 +218,7 @@ gulp.task('start-preview-server', function () {
connect.server({ connect.server({
root: 'preview', root: 'preview',
port: 7888, port: 7888,
https: false, https: false
}); });
}); });
@@ -248,8 +248,8 @@ exports.devRelease = gulp.series(
'copyFiles', 'copyFiles',
'fixIndex', 'fixIndex',
'useRef', 'useRef',
'concatSwRegistration', // 'concatSwRegistration',
'generate-service-worker', // 'generate-service-worker',
'buildDistFolder', 'buildDistFolder',
'cleanup' 'cleanup'
); );

View File

@@ -4,9 +4,9 @@
"description": "A blazing fast & offline web playground", "description": "A blazing fast & offline web playground",
"scripts": { "scripts": {
"start": "npm run -s dev", "start": "npm run -s dev",
"build": "preact build --template src/index.html --prerender false --sw false", "build": "preact build --prerender false",
"serve": "preact build && preact serve", "serve": "preact build && preact serve",
"dev": "preact watch --template src/index.html --prerender false", "dev": "preact watch",
"serve-website": "cd packages/website; npm start", "serve-website": "cd packages/website; npm start",
"build-website": "cd packages/website; npm run build", "build-website": "cd packages/website; npm run build",
"lint": "eslint src", "lint": "eslint src",

View File

@@ -15,7 +15,7 @@ export default function (config, env, helpers) {
)[0]; )[0];
Object.assign(htmlWebpackPlugin.plugin.options.minify, { Object.assign(htmlWebpackPlugin.plugin.options.minify, {
removeComments: false, removeComments: false,
collapseWhitespace: false, collapseWhitespace: false
}); });
htmlWebpackPlugin.plugin.options.preload = false; htmlWebpackPlugin.plugin.options.preload = false;
htmlWebpackPlugin.plugin.options.favicon = false; htmlWebpackPlugin.plugin.options.favicon = false;
@@ -46,12 +46,12 @@ export default function (config, env, helpers) {
'SWPrecacheWebpackPlugin' 'SWPrecacheWebpackPlugin'
)[0]; )[0];
if (swPlugin) { if (swPlugin) {
config.plugins.splice(swPlugin.index, 1); // config.plugins.splice(swPlugin.index, 1);
} }
const uglifyPlugin = helpers.getPluginsByName(config, 'UglifyJsPlugin')[0]; const uglifyPlugin = helpers.getPluginsByName(config, 'UglifyJsPlugin')[0];
if (uglifyPlugin) { if (uglifyPlugin) {
config.plugins.splice(uglifyPlugin.index, 1); // config.plugins.splice(uglifyPlugin.index, 1);
} }
} }
} }