mirror of
https://github.com/fluencelabs/marine.git
synced 2025-03-15 14:00:50 +00:00
42 lines
944 B
JavaScript
42 lines
944 B
JavaScript
// Generated using webpack-cli https://github.com/webpack/webpack-cli
|
|
|
|
const path = require('path');
|
|
|
|
// const isProduction = true;
|
|
// uncomment to debug
|
|
const isProduction = false;
|
|
|
|
const config = (ifDefOpts) => ({
|
|
entry: './src/backgroundScript.ts',
|
|
output: {
|
|
path: path.resolve('dist'),
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.(js|ts|tsx)$/i,
|
|
use: [
|
|
// force new line
|
|
{ loader: 'ts-loader' },
|
|
{ loader: 'ifdef-loader', options: ifDefOpts },
|
|
],
|
|
exclude: ['/node_modules/'],
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: ['.tsx', '.ts', '.js'],
|
|
},
|
|
});
|
|
|
|
module.exports = (ifDefConfig) => {
|
|
const res = config(ifDefConfig);
|
|
if (isProduction) {
|
|
res.mode = 'production';
|
|
} else {
|
|
res.mode = 'development';
|
|
}
|
|
|
|
return res;
|
|
};
|