mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
5f4c19da35
Co-authored-by: Opender Singh <opender.singh@konghq.com>
39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
const path = require('path');
|
|
const createStyledComponentsTransformer = require('typescript-plugin-styled-components').default;
|
|
const styledComponentsTransformer = createStyledComponentsTransformer();
|
|
|
|
/** @type { import('webpack').Configuration } */
|
|
module.exports = {
|
|
entry: { index: './src/index.ts' },
|
|
target: 'web',
|
|
output: {
|
|
path: path.resolve(__dirname, '../dist'),
|
|
filename: '[name].js',
|
|
sourceMapFilename: '[name].js.map',
|
|
library: 'insomniaComponents',
|
|
libraryTarget: 'commonjs2',
|
|
},
|
|
optimization: {
|
|
// Disable minification for now, otherwise smoke tests fail
|
|
// Note, minification is disabled in insomnia-app as well
|
|
minimize: false,
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.tsx?$/,
|
|
loader: 'ts-loader',
|
|
exclude: [/node_modules/],
|
|
options: {
|
|
configFile: 'tsconfig.build.json',
|
|
getCustomTransformers: () => ({ before: [styledComponentsTransformer] }),
|
|
},
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: ['.js', '.json', '.ts', '.tsx'],
|
|
},
|
|
externals: ['react', 'react-dom', 'styled-components'],
|
|
};
|