You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
433 B
16 lines
433 B
12 months ago
|
const fs = require('fs');
|
||
|
const log = require('./log');
|
||
|
const compile = require('./compile');
|
||
|
|
||
|
module.exports = (filePath) => {
|
||
|
log(`'${filePath}' is being processed.`);
|
||
|
// Transform the file.
|
||
|
compile(filePath, function write(code) {
|
||
|
const fileName = filePath.slice(0, -7);
|
||
|
// Write the result to the filesystem.
|
||
|
fs.writeFile(`${fileName}.js`, code, () => {
|
||
|
log(`'${filePath}' is finished.`);
|
||
|
});
|
||
|
});
|
||
|
}
|