11const path = require ( "path" ) ;
22const HtmlPlugin = require ( "html-webpack-plugin" ) ;
3+ const webpack = require ( "webpack" ) ;
4+
5+ function reolveToDir ( relPath ) {
6+ return path . resolve ( __dirname , relPath ) ;
7+ }
38
49module . exports = {
510 module : {
611 rules : [
712 {
8- test : / \. ( j s | j s x | t s | t s x ) $ / ,
9- exclude : / n o d e _ m o d u l e s / ,
13+ test : / \. ( j s x | t s | t s x ) $ / ,
1014 use : {
1115 loader : "babel-loader" ,
1216 } ,
1317 } ,
18+ {
19+ test : [
20+ / \/ e s l i n t \/ .* \/ r u l e - t e s t e r / ,
21+ / \/ e s l i n t \/ .* \/ c l i - e n g i n e / ,
22+ / \/ r e s o l v e - f r o m \/ * / ,
23+ / \/ \@ e s l i n t \/ .* \/ c o n f i g - a r r a y - f a c t o r y / ,
24+ / \/ \@ e s l i n t \/ .* \/ r e l a t i v e - m o d u l e - r e s o l v e r / ,
25+ / \/ e s l i n t \/ e s l i n t \. j s / ,
26+ // /\/@typescript-eslint\/experimental-utils\/dist\/ts-eslint/,
27+ / \/ @ t y p e s c r i p t - e s l i n t \/ e x p e r i m e n t a l - u t i l s \/ d i s t \/ t s - e s l i n t \/ R u l e T e s t e r .j s / ,
28+ / \/ @ t y p e s c r i p t - e s l i n t \/ e x p e r i m e n t a l - u t i l s \/ d i s t \/ e s l i n t - u t i l s \/ R u l e T e s t e r .j s / ,
29+ / \/ @ t y p e s c r i p t - e s l i n t \/ .* \/ C L I E n g i n e / ,
30+ // /\/@typescript-eslint\/.*\/globby/,
31+ / \/ @ t y p e s c r i p t - e s l i n t \/ .* \/ c r e a t e - p r o g r a m \/ c r e a t e W a t c h P r o g r a m .j s / ,
32+ / \. d \. t s $ / ,
33+ ] ,
34+ use : "null-loader" ,
35+ } ,
1436 {
1537 test : / \. h t m l $ / ,
1638 use : [
@@ -20,6 +42,10 @@ module.exports = {
2042 } ,
2143 ] ,
2244 } ,
45+ {
46+ test : / \. c s s $ / ,
47+ use : [ "style-loader" , "css-loader" ] ,
48+ } ,
2349 ] ,
2450 } ,
2551 resolve : {
@@ -33,12 +59,26 @@ module.exports = {
3359 extensions : [ ".tsx" , ".ts" , ".js" , ".jsx" ] ,
3460 } ,
3561 plugins : [
62+ new webpack . NormalModuleReplacementPlugin (
63+ / r e s o l v e \- f r o m / ,
64+ path . resolve ( __dirname , "./src/modules/resolve-from.js" )
65+ ) ,
66+ new webpack . NormalModuleReplacementPlugin (
67+ / e s q u e r y / ,
68+ path . resolve ( __dirname , "./node_modules/esquery/dist/esquery.js" )
69+ ) ,
70+ new webpack . NormalModuleReplacementPlugin (
71+ / g l o b b y / ,
72+ path . resolve ( __dirname , "./src/modules/globby.js" )
73+ ) ,
3674 new HtmlPlugin ( {
3775 template : "./src/index.html" ,
3876 filename : "./index.html" ,
3977 } ) ,
4078 ] ,
4179 output : {
80+ filename : "[name].[hash].js" ,
81+ chunkFilename : "[name].[hash].js" ,
4282 publicPath : "/" ,
4383 } ,
4484} ;
0 commit comments