Last active
February 3, 2021 13:07
-
-
Save iOliverNguyen/a7e65ee1e6ca47aeb7ef9e7edf697eab to your computer and use it in GitHub Desktop.
code snippets for https://olvrng.github.com/w/esm
This file contains 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
<script type="module" src="myscript.js"></script> |
This file contains 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>My little app</title> | |
</head> | |
<body> | |
<script type="module" src="myscript.js"></script> | |
</body> | |
</html> |
This file contains 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
// somewhere in lodash package | |
function snakeCase(input) { | |
// where magic happens | |
} | |
exports.snakeCase = snakeCase; |
This file contains 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
// somewhere in lodash package | |
export function snakeCase(input) { | |
// where magic happens | |
} |
This file contains 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
// myscript.ts | |
import {snakeCase} from 'lodash'; | |
import './style.less'; // the less file | |
const words: string[] = ['HelloWorld', 'left pad', 'ECMAScript']; | |
words.forEach(text => { | |
console.log(snakeCase(text)); | |
}); |
This file contains 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 {snakeCase} = require('lodash'); | |
['HelloWorld', 'left pad', 'ECMAScript'].forEach(text => { | |
console.log(snakeCase(text)); | |
}); |
This file contains 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
// myscript.js | |
import { snakeCase } from 'https://cdn.skypack.dev/lodash@4'; | |
['HelloWorld', 'left pad', 'ECMAScript'].forEach(text => { | |
console.log(snakeCase(text)); | |
}); |
This file contains 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
import {snakeCase} from 'lodash'; | |
['HelloWorld', 'left pad', 'ECMAScript'].forEach(text => { | |
console.log(snakeCase(text)); | |
}); |
This file contains 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
// myscript.ts | |
import {snakeCase} from 'lodash'; | |
const words: string[] = ['HelloWorld', 'left pad', 'ECMAScript']; | |
words.forEach(text => { | |
console.log(snakeCase(text)); | |
}); |
This file contains 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
<script src="https://unpkg.com/react@17/umd/react.development.js"></script> | |
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script> | |
<script> | |
ReactDOM.render( | |
<h1>Hello, world!</h1>, | |
document.getElementById('root') | |
); | |
</script> |
This file contains 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
// snowpack.config.js | |
plugins: [ | |
'snowpack-plugin-less', | |
], |
This file contains 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
// snowpack.config.js | |
packageOptions: { | |
source: 'remote', | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment