mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
fix: set the options by setting the config file
This commit is contained in:
parent
2f0cbdeb08
commit
8a19065e90
10
src/babel.js
10
src/babel.js
@ -3,6 +3,7 @@
|
||||
const crypto = require('crypto');
|
||||
const path = require('path');
|
||||
const defaultOptions = require('./babel.config.js');
|
||||
const configFile = path.join(__dirname, './babel.config.js');
|
||||
|
||||
let babel = null;
|
||||
let babelVersionDirectory = null;
|
||||
@ -56,11 +57,10 @@ exports.compile = function(sourceCode, filePath) {
|
||||
filePath = 'file:///' + path.resolve(filePath).replace(/\\/g, '/');
|
||||
}
|
||||
|
||||
const options = { filename: filePath };
|
||||
for (const key in defaultOptions) {
|
||||
options[key] = defaultOptions[key];
|
||||
}
|
||||
return babel.transformSync(sourceCode, options).code;
|
||||
return babel.transformSync(sourceCode, {
|
||||
filename: filePath,
|
||||
configFile
|
||||
}).code;
|
||||
};
|
||||
|
||||
function createVersionAndOptionsDigest(version, options) {
|
||||
|
Loading…
Reference in New Issue
Block a user