https://github.com/sayan751/babel-webpack-demo
https://github.com/sayan751/babel-webpack-demo
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sayan751/babel-webpack-demo
- Owner: Sayan751
- Created: 2024-04-27T06:22:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-27T06:40:16.000Z (about 2 years ago)
- Last Synced: 2025-03-03T10:44:18.488Z (over 1 year ago)
- Language: JavaScript
- Size: 48.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Babel Webpack Decorator Demo
This repository demonstrates an issue with webpack and babel-loader when using decorators.
## Reproduction steps
- Run the following command to prepare a nginx container with the compiled files.
```shell
# Replace PATH_TO with correct path
docker run --name babel-webpack-deco-demo --mount type=bind,source=PATH_TO\babel-webpack-demo\dist,target=/usr/share/nginx/html,readonly -p 9899:80 -d nginx
```
- Do `npm ci`
- Do `npm run build`
- Open `http://localhost:9899` in browser
Following error will be shown in console: `Uncaught ReferenceError: testVarOne is not defined`
If the decorator usage (`@bar`) in the `my-element.js` is removed, the error will disappear.