1.4.0 • Published 16 days ago
replace-absolute-path v1.4.0
replace-absolute-path
- usage:
const fs = require('fs');
const replacePath = require('replace-absolute-path');
(async function () {
const srcDir = path.resolve(__dirname, '../src');
const libDir = path.resolve(__dirname, '../lib');
replacePath({
inputDir: srcDir,
outputDir: libDir,
// includeExts: replacePath.DEFAULT_EXTS.concat(['.md']),
afterReplaced: () => {
console.log('--------------------------------------------------------------------------');
console.log('| all files import statements has been transformed to relative path ^_^ |');
console.log('--------------------------------------------------------------------------');
},
});
})();
now your file import statements changed
// if current file position is /src/components/Editor/index.js
// config file position is /src/config.js
import xx from 'configs/xx';
// change to
import xx from '../../configs/xx';
export { default as xx } from 'configs/xx';
// change to
export { default as xx } from '../../configs/xx';
import { xx } from 'configs/xx';
// change to
import { xx } from '../../configs/xx';
1.4.0
16 days ago
1.3.9
16 days ago
1.3.7
18 days ago
1.3.8
18 days ago
1.3.6
2 months ago
1.3.5
2 months ago
1.3.4
1 year ago
1.3.3
1 year ago
1.3.2
1 year ago
1.2.3
1 year ago
1.3.1
1 year ago
1.2.2
1 year ago
1.3.0
1 year ago
1.2.1
1 year ago
1.2.0
2 years ago
1.1.1
2 years ago
1.0.2
2 years ago
1.1.0
2 years ago
1.1.2
2 years ago
1.0.3
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago