Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jabranr/babel-vs-babel-loader
Investigation on babel vs babel-loader output. Experimental repository.
https://github.com/jabranr/babel-vs-babel-loader
babel babel-loader commonjs commonjs-modules es6 es6-modules javascript modules webpack
Last synced: 11 days ago
JSON representation
Investigation on babel vs babel-loader output. Experimental repository.
- Host: GitHub
- URL: https://github.com/jabranr/babel-vs-babel-loader
- Owner: jabranr
- License: mit
- Created: 2019-05-24T02:08:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T22:32:21.000Z (about 2 years ago)
- Last Synced: 2024-11-15T22:16:51.956Z (2 months ago)
- Topics: babel, babel-loader, commonjs, commonjs-modules, es6, es6-modules, javascript, modules, webpack
- Language: JavaScript
- Homepage:
- Size: 4.3 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `babel` vs `babel-loader`
Investigating output from `babel` and `babel-loader` which is vastly different from each other.## Objective
Make a `React` component ready to be published to `npm` as a module. Intended targets are `es6` and `commonjs` modules.## Usage
### Install dependencies
```
npm install
```### Start app
Running following command will start the app and watch for changes.
```
npm start
```Then you can edit `src/index.js` to try each version of the build such as:
### ES6
```diff
- import JoeBloggs from './components/joe-bloggs';
+ import JoeBloggs from './components/joe-bloggs/dist';
```### CommonJS
```diff
- import JoeBloggs from './components/joe-bloggs';
+ import JoeBloggs from './components/joe-bloggs/dist/cjs';
```> Please note that any styles will be stripped off in CommonJS version
Details of the issue (now resolved) from this step onwards are [here](https://github.com/jabranr/babel-vs-babel-loader/issues/1)
### Build
```
npm run build
```This will output results into `dist/`.
## License
MIT License© Jabran Rafique – 2019