-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
When I run nps build it creates a prod build. Looking in /dist there's no declaration file.
My repo is here: https://github.com/TGRstack/typescript-module
There's a lot of config but the relevant bits are:
// common
const outputName = 'index'
module.exports = {
entry: {
main: paths.src.entry
},
output: {
path: paths.build._,
filename: `${outputName}.js`,
libraryTarget: 'commonjs'
},
resolve: {
extensions: ['.csv', '.ts', '.js', '.json',],
modules: ['src', 'node_modules'],
},
module: {
rules: [
typescript.loader,
// graphql,
files,
],
},
plugins: [
new Dotenv(dotEnvOpts),
// typescript.paths,
new TSDeclerationsPlugin({
main: 'main',
output: `${outputName}.d.ts`
}),
],
target: 'node',
externals: [nodeExternals()],
node: {
__dirname: false,
__filename: false,
},
}
https://github.com/TGRstack/typescript-module/blob/master/webpack/webpack.prod.js
// webpack prod
const webpackCommon = require('./webpack.common');
module.exports = merge(webpackCommon, {
mode: 'production',
devtool: false, // README.md
bail: true,
plugins: [
new TerserPlugin({
parallel: true,
terserOptions: {
ecma: 6,
},
}),
],
})
Metadata
Metadata
Assignees
Labels
No labels