forked from jsdevkr/gitCodeShare.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
47 lines (44 loc) · 1.19 KB
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const withPlugins = require('next-compose-plugins');
const withCSS = require('@zeit/next-css');
const withLess = require('@zeit/next-less');
const withSass = require('@zeit/next-sass');
const withTypescript = require('@zeit/next-typescript');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
module.exports = withPlugins([
[
withTypescript,
{
webpack(config, options) {
// Do not run type checking twice:
if (options.isServer) config.plugins.push(new ForkTsCheckerWebpackPlugin());
// Add entry point for chrome extention TODO: What about HTML?
// const entryFactory = config.entry;
// config.entry = () =>
// entryFactory().then(entry => {
// entry['main.js'] = ['./chrome-extension/src/index.ts', ...entry['main.js']];
// return entry;
// });
return config;
},
},
],
[
withLess,
{
lessLoaderOptions: {
javascriptEnabled: true,
},
},
],
[withSass],
[
withCSS,
{
cssModules: true,
cssLoaderOptions: {
importLoaders: 1,
localIdentName: '[local]___[hash:base64:5]',
},
},
],
]);