Skip to content

Instantly share code, notes, and snippets.

@davidnguyen11
Created April 25, 2019 05:14
Show Gist options
  • Save davidnguyen11/c2f931f86a3820181417c71171e5856e to your computer and use it in GitHub Desktop.
Save davidnguyen11/c2f931f86a3820181417c71171e5856e to your computer and use it in GitHub Desktop.
var fs = require('fs');
var mv = require('mv');
var dirs = ['app/.next/_next', 'app/.next/_next/build', 'app/.next/_next/build/page', 'app/.next/_next/static'];
const PAGE_PATH = {
old: 'app/.next/bundles/pages',
new: 'app/.next/_next/build/page'
};
const STATIC_PATH = {
old: 'app/.next/static',
new: 'app/.next/_next/static'
};
// create dir
dirs.forEach(item => {
fs.mkdirSync(item);
});
// move files
mv(PAGE_PATH.old, PAGE_PATH.new, { mkdirp: true }, function(err) {
if (err) console.log(err);
});
mv(STATIC_PATH.old, STATIC_PATH.new, { mkdirp: true }, function(err) {
if (err) console.log(err);
});
var fs = require('fs');
var mv = require('mv');
var dirs = [
'app/.next/_next',
'app/.next/_next/static',
];
const STATIC_PATH = {
old: 'app/.next/static',
new: 'app/.next/_next/static'
};
// create dir
dirs.forEach(item => {
fs.mkdirSync(item);
});
mv(STATIC_PATH.old, STATIC_PATH.new, { mkdirp: true }, function(err) {
if (err) console.log(err);
});
var fs = require('fs');
var mv = require('mv');
var dirs = ['.next/_next', '.next/_next/static'];
const STATIC_PATH = {
old: '.next/static',
new: '.next/_next/static'
};
// create dir
dirs.forEach(item => {
fs.mkdirSync(item);
});
mv(STATIC_PATH.old, STATIC_PATH.new, { mkdirp: true }, function(err) {
if (err) console.log(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment