Created
April 25, 2019 05:14
-
-
Save davidnguyen11/c2f931f86a3820181417c71171e5856e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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); | |
| }); |
This file contains hidden or 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
| 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); | |
| }); |
This file contains hidden or 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
| 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