mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-24 16:55:24 +03:00
chore: ESM for localization
This commit is contained in:
parent
4fa1f6a4c0
commit
73172bdb04
10 changed files with 90 additions and 15 deletions
|
@ -1,3 +1,9 @@
|
|||
const commonjs = require("@rollup/plugin-commonjs");
|
||||
const resolve = require("@rollup/plugin-node-resolve").default;
|
||||
const rollupReplace = require("@rollup/plugin-replace");
|
||||
|
||||
const NODE_ENV = process.env.NODE_ENV || 'test';
|
||||
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
reporters: ['tfs', 'spec'],
|
||||
|
@ -10,7 +16,7 @@ module.exports = function(config) {
|
|||
'./node_modules/jbox/dist/jBox.min.js',
|
||||
'./src/js/serial.js',
|
||||
'./src/js/data_storage.js',
|
||||
'./src/js/localization.js',
|
||||
{ pattern: './src/js/localization.js', type: 'module', watched: false },
|
||||
'./src/js/gui.js',
|
||||
'./src/js/CliAutoComplete.js',
|
||||
'./src/js/tabs/cli.js',
|
||||
|
@ -29,5 +35,20 @@ module.exports = function(config) {
|
|||
outputFile: 'test_results.xml',
|
||||
},
|
||||
singleRun: true,
|
||||
preprocessors: {
|
||||
'./src/js/localization.js': ['rollup'],
|
||||
},
|
||||
rollupPreprocessor: {
|
||||
plugins: [
|
||||
rollupReplace({
|
||||
'process.env.NODE_ENV': JSON.stringify(NODE_ENV),
|
||||
}),
|
||||
resolve(),
|
||||
commonjs(),
|
||||
],
|
||||
output: {
|
||||
format: 'esm',
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue