Skip to content

Commit f8e1c91

Browse files
feat: enable webapack optimization
1 parent fcead1f commit f8e1c91

File tree

2 files changed

+13
-23
lines changed

2 files changed

+13
-23
lines changed

backend/types/index.d.ts

-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@ declare module '*.json' {
33
export default value;
44
}
55

6-
declare module '*.gql' {
7-
import { DocumentNode } from 'graphql';
8-
9-
const content: DocumentNode;
10-
export default content;
11-
}
12-
136
declare module '*.graphql' {
147
import { DocumentNode } from 'graphql';
158

backend/webpack.config.js

+13-16
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ const BUNDLE = {
1919
entry: './index.ts',
2020
output: {
2121
filename: 'app.js',
22-
path: path.resolve(__dirname, 'build'),
23-
},
22+
path: path.resolve(__dirname, 'build')
23+
}
2424
};
2525

2626
module.exports = {
@@ -30,7 +30,7 @@ module.exports = {
3030
stats: 'errors-only',
3131
node: {
3232
__dirname: true,
33-
__filename: true,
33+
__filename: true
3434
},
3535
module: getLoaders(),
3636
plugins: getPlugins(),
@@ -41,13 +41,10 @@ module.exports = {
4141
'@backend/graphql': path.resolve(__dirname, 'packages/graphql'),
4242
'@backend/utils': path.resolve(__dirname, 'packages/utils'),
4343
'@backend/db': path.resolve(__dirname, 'packages/db'),
44-
graphql$: path.resolve(__dirname, 'node_modules/graphql/index.js'),
45-
},
46-
},
47-
optimization: {
48-
minimize: false,
44+
graphql$: path.resolve(__dirname, 'node_modules/graphql/index.js')
45+
}
4946
},
50-
output: BUNDLE.output,
47+
output: BUNDLE.output
5148
};
5249

5350
/**
@@ -57,21 +54,21 @@ function getLoaders() {
5754
const graphql = {
5855
test: /\.(graphql|gql)$/,
5956
exclude: /node_modules/,
60-
loader: 'graphql-tag/loader',
57+
loader: 'graphql-tag/loader'
6158
};
6259

6360
const esbuild = {
6461
test: /\.(js|jsx|ts|tsx)?$/,
6562
loader: 'esbuild-loader',
6663
options: {
6764
loader: 'tsx',
68-
target: 'es2015',
65+
target: 'es2015'
6966
},
70-
exclude: /node_modules/,
67+
exclude: /node_modules/
7168
};
7269

7370
const loaders = {
74-
rules: [graphql, esbuild],
71+
rules: [graphql, esbuild]
7572
};
7673

7774
return loaders;
@@ -89,9 +86,9 @@ function getPlugins() {
8986
memoryLimit: 8192,
9087
diagnosticOptions: {
9188
semantic: true,
92-
syntactic: true,
93-
},
94-
},
89+
syntactic: true
90+
}
91+
}
9592
});
9693
// Order matters!
9794
return [dotEnv, typescriptChecker, nodemon];

0 commit comments

Comments
 (0)