Created
September 18, 2019 06:29
-
-
Save webhacking/aa1b99fe2e6b028cd87f4ea818a81113 to your computer and use it in GitHub Desktop.
Revisions
-
webhacking created this gist
Sep 18, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ // const webpack = require('webpack'); const path = require('path'); const nodeExternals = require('webpack-node-externals'); const slsw = require('serverless-webpack'); const isLocal = slsw.lib.webpack.isLocal; module.exports = { mode: isLocal ? 'development' : 'production', // entry: slsw.lib.entries, entry: './src/main.ts', target: 'node', devtool: 'source-map', externals: [nodeExternals()], node: { __dirname: true, }, module: { rules: [ { test: /\.tsx?$/, exclude: /node_modules/, loader: 'ts-loader' } ], }, optimization: { removeAvailableModules: false, removeEmptyChunks: false, splitChunks: false, }, resolve: { extensions: ['.ts', '.tsx', '.js', '.jsx'], modules: [path.resolve('./src'), 'node_modules'] }, output: { libraryTarget: 'commonjs', // path: path.join(__dirname, '.webpack'), path: path.join(__dirname, 'dist'), filename: '[name].js', pathinfo: false }, };