Skip to content

[DRAFT] - cjs module transforms - #168

Closed
JoviDeCroock wants to merge 4 commits into
mainfrom
cjs
Closed

[DRAFT] - cjs module transforms#168
JoviDeCroock wants to merge 4 commits into
mainfrom
cjs

Conversation

@JoviDeCroock

Copy link
Copy Markdown
Member

This is my initial attempt at implementing cjs-module-lexer, ... I couldn't get the tests to run properly on my windows machine so I'm going to defer this for when I'm at my MBP.

@github-actions

github-actions Bot commented Oct 24, 2020

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 679 kB

ℹ️ View Unchanged
Filename Size Change
demo/dist/assets/Calendar.********.css 702 B 0 B
demo/dist/assets/style.********.css 266 B 0 B
demo/dist/assets/style.module.********.css 53 B 0 B
demo/dist/chunks/_wmr.********.js 122 B 0 B
demo/dist/chunks/class-fields.********.js 208 B 0 B
demo/dist/chunks/compat.********.js 15 kB 0 B
demo/dist/chunks/index.********.js 211 B 0 B
demo/dist/index.********.js 6.36 kB 0 B
demo/dist/index.html 402 B 0 B
wmr.cjs 656 kB 0 B

compressed-size-action

Comment thread src/wmr-middleware.js
import sassPlugin from './plugins/sass-plugin.js';
import processGlobalPlugin from './plugins/process-global-plugin.js';
import { getMimeType } from './lib/mimetypes.js';
import fastCjsPlugin from './plugins/fast-cjs-plugin.js';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if it'd be easier to have transformRequires() just be part of fastCjsPlugin? Right now this PR disables CommonJS in prod I think.

@developit developit added the compat CJS/UMD/etc label Nov 30, 2020
@developit developit added this to the 1.1 milestone Nov 30, 2020
@developit developit linked an issue Nov 30, 2020 that may be closed by this pull request
4 tasks
@developit developit modified the milestones: 1.1, 1.2 Dec 6, 2020
@developit developit added the DRAFT Draft, not ready for merging label Dec 17, 2020
Comment thread demo/public/cjs.js
console.log(h);
exports.Test = 'test2';

module.exports = 'test';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really something that should be allowed? Breaks in node

Base automatically changed from master to main January 22, 2021 18:07
@JoviDeCroock

Copy link
Copy Markdown
Member Author

I'll try redo'ing this PR, it's gotten a bit outdated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compat CJS/UMD/etc DRAFT Draft, not ready for merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch CommonJS transform to cjs-module-lexer

3 participants