Created
May 21, 2021 10:48
-
-
Save ttraenkler/18a71e7fc2d1a53a7f8b69dbbea7de1c to your computer and use it in GitHub Desktop.
cloudflare worker webpack config
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 characters
| const path = require('path'); | |
| const mode = process.env.NODE_ENV || 'production'; | |
| module.exports = { | |
| entry: __dirname, | |
| output: { | |
| filename: `worker.js`, | |
| path: path.join(__dirname.replace('/workers-site', ''), 'dist'), | |
| }, | |
| mode, | |
| resolve: { | |
| extensions: ['.ts', '.tsx', '.js'], | |
| plugins: [], | |
| alias: { | |
| packages: path.resolve(__dirname, 'packages'), | |
| }, | |
| }, | |
| module: { | |
| rules: [ | |
| { | |
| test: /\.tsx?$/, | |
| loader: './workers-site/node_modules/ts-loader', | |
| options: { | |
| transpileOnly: true, | |
| }, | |
| }, | |
| { | |
| test: /\.html$/i, | |
| loader: './workers-site/node_modules/html-loader', | |
| }, | |
| { | |
| test: /\.css$/i, | |
| loader: './workers-site/node_modules/css-loader', | |
| }, | |
| ], | |
| }, | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment