webpack.config.js 549 B

12345678910111213141516171819202122232425
  1. const path = require('path');
  2. module.exports = {
  3. mode: 'production',
  4. entry: './src/frontend.ts',
  5. module: {
  6. rules: [
  7. {
  8. test: /\.tsx?$/,
  9. use: 'ts-loader',
  10. exclude: /node_modules/
  11. }
  12. ]
  13. },
  14. resolve: {
  15. extensions: ['.tsx', '.ts', '.js']
  16. },
  17. output: {
  18. filename: 'frontend.js',
  19. path: path.resolve(__dirname, 'dist'),
  20. library: 'astro',
  21. libraryTarget: 'window',
  22. libraryExport: 'default'
  23. }
  24. };