Skip to content

Commit

Permalink
Change webpack configure options and clean up configuration
Browse files Browse the repository at this point in the history
Signed-off-by: AbhishekReddy1127 <[email protected]>
  • Loading branch information
AbhishekReddy1127 committed Mar 13, 2023
1 parent 681cb90 commit 0b8cdfa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
6 changes: 3 additions & 3 deletions scripts/babel/proptypes-from-ts-props/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2556,7 +2556,7 @@ export { Foo };
babelOptions
);

expect(result.code).toBe('');
expect(result.code).toBe('export {};');
});

it('removes multiple type export from ExportNamedDeclaration', () => {
Expand All @@ -2569,7 +2569,7 @@ export { Foo, Bar };
babelOptions
);

expect(result.code).toBe('');
expect(result.code).toBe('export {};');
});

it('removes type exports from ExportNamedDeclaration, leaving legitimate exports', () => {
Expand Down Expand Up @@ -2666,7 +2666,7 @@ export type Foo = string;
babelOptions
);

expect(result.code).toBe('');
expect(result.code).toBe('export {};');
});

it('removes 3rd-party type exports', () => {
Expand Down
17 changes: 12 additions & 5 deletions src-docs/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,21 @@ const webpackConfig = {
},
{
test: /\.(woff|woff2|ttf|eot|ico)(\?|$)/,
loader: 'file-loader',
type: 'asset/resource',
generator: {
filename: 'fonts/[name][ext]',
},
},
{
test: /\.(png|jp(e*)g|svg|gif)$/,
loader: 'url-loader',
options: {
limit: 8000, // Convert images < 8kb to base64 strings
name: 'images/[hash]-[name].[ext]',
type: 'asset',
generator: {
filename: 'images/[contenthash]-[name][ext]',
},
parser: {
dataUrlCondition: {
maxSize: 8 * 1024,
},
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion src/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,6 @@ module.exports = {
optimization: {
minimize: isProduction,
minimizer: [terserPlugin],
noEmitOnErrors: true,
emitOnErrors: false,
},
};

0 comments on commit 0b8cdfa

Please sign in to comment.