Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no .d.ts generated #3

Open
Falieson opened this issue Feb 15, 2019 · 0 comments
Open

no .d.ts generated #3

Falieson opened this issue Feb 15, 2019 · 0 comments

Comments

@Falieson
Copy link

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,
      },
    }),
  ],
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant