diff --git a/config/paths.js b/config/paths.js index 7605a4d4..7b5f7cc0 100644 --- a/config/paths.js +++ b/config/paths.js @@ -79,6 +79,7 @@ module.exports = { appPackageJson: resolveApp('package.json'), appSrc: resolveApp('src'), appSrcLib: resolveApp('src/lib'), + appSrcLibTypes: resolveApp('src/lib/@types'), appSrcDemo: resolveApp('src/demo'), appTsConfig: resolveApp('tsconfig.json'), yarnLockFile: resolveApp('yarn.lock'), diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 703bbdb9..3804cb40 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -21,6 +21,7 @@ const getClientEnvironment = require('./env'); const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin'); const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin-alt'); const typescriptFormatter = require('react-dev-utils/typescriptFormatter'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); const getPackageJson = require('./getPackageJson'); @@ -510,6 +511,12 @@ module.exports = { // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack // You can remove this if you don't use Moment.js: new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), + new CopyWebpackPlugin([ + { + from: `${paths.appSrcLibTypes}`, + to: paths.appLayoutsBuild + } + ]), // Generate a service worker script that will precache, and keep up to date, // the HTML & assets that are part of the Webpack build. /*new WorkboxWebpackPlugin.GenerateSW({