Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = api => {
const config = getBabelConfig(api);
config.plugins = config.plugins || [];
config.plugins.push(
'version-inline',
// NOTE: To debug our babel plugins, just reference the local modules
// './dev-modules/babel-plugin-inline-gl-constants',
'babel-plugin-inline-webgl-constants',
// ['./dev-modules/babel-plugin-remove-glsl-comments', {
[
'babel-plugin-remove-glsl-comments',
{
patterns: ['**/shadertools/src/modules/**/*.js']
}
]
);
module.exports = api => {
const config = getBabelConfig(api);
config.plugins = config.plugins || [];
config.plugins.push([
'babel-plugin-inline-import',
{
extensions: ['.worker.js']
}
]);
// https://babeljs.io/docs/en/options#overrides
const overrides = config.overrides || [];
// TEST to prevent compilation of already transpiled files
// These files should be copied without any modification
overrides.push({
test: /min.js|transpiled.js/,
compact: false,
module.exports = api => {
const config = getBabelConfig(api);
config.plugins = config.plugins || [];
config.plugins.push('version-inline');
// https://babeljs.io/docs/en/options#overrides
const overrides = config.overrides || [];
// TEST to prevent compilation of already transpiled files
// TODO: Ideally these files should be copied to the right dist folder without any further modification
// It still seems they are being parsed by babel which does take a relatively long time
overrides.push({
test: /src\/libs/,
compact: false,
sourceMaps: false
});
// Default babel config (env, plugin) only apply to the rest of the files
overrides.push({
module.exports = api => {
const config = getBabelConfig(api);
config.presets = (config.presets || []).concat(['@babel/flow', '@babel/preset-react']);
config.plugins = (config.plugins || []).concat('@babel/proposal-class-properties');
return config;
};
module.exports = api => getBabelConfig(api);
module.exports = api => {
const config = getBabelConfig(api);
config.presets = config.presets || [];
config.presets.push('@babel/react', '@babel/flow');
config.plugins = config.plugins || [];
config.plugins.push('version-inline', '@babel/proposal-class-properties');
return config;
};
module.exports = api => {
return getBabelConfig(api, {
plugins: [['transform-builtin-extend', {globals: ['Array']}]]
});
};
module.exports = api => {
const config = getBabelConfig(api);
config.plugins = config.plugins || [];
config.plugins.push('version-inline', '@babel/proposal-class-properties', [
'babel-plugin-inline-import',
{
extensions: ['.worker.js']
}
]);
return config;
};
module.exports = api => {
const config = getBabelConfig(api);
config.plugins.push('version-inline', 'inline-webgl-constants', [
'remove-glsl-comments',
{
patterns: ['**/*.glsl.js']
}
]);
return config;
};