Repository URL to install this package:
|
Version:
1.3.3 ▾
|
@skava/graphql
/
webpack.config.js
|
|---|
const path = require('path')
const nodeExternals = require('webpack-node-externals')
const NodemonPlugin = require('nodemon-webpack-plugin')
module.exports = webpack => {
return {
target: 'node',
devtool: 'cheap-module-source-map',
mode: process.env.NODE_ENV === 'development' ? 'development' : 'production',
entry: './src/index.ts',
output: {
path: path.resolve('./dist'),
filename: 'server.js',
},
externals: nodeExternals(),
module: {
rules: [
{
exclude: /node_modules/,
test: /\.graphql$/,
use: [{ loader: 'graphql-import-loader' }],
},
{
test: /\.t|jsx?$/,
exclude: /(node_modules)/,
use: [
{
loader: require.resolve('ts-loader'),
options: {
// disable type checker - we will use it in fork plugin
transpileOnly: true,
// https://github.com/TypeStrong/ts-loader#ignorediagnostics-number-default
},
},
],
// options: {cacheDirectory: true},
},
],
},
resolve: {
mainFields: ['main', 'module'],
extensions: ['.js', '.ts', '.json'],
},
plugins: [new NodemonPlugin()],
}
}