Created
November 14, 2019 21:20
-
-
Save painor/b26153151e5a5f8b7b9b6124178efa0f to your computer and use it in GitHub Desktop.
testing webpack
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
function f() { | |
console.log('ok') | |
} | |
module.exports = { | |
f, | |
} |
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 { f } from './gramjs.js' | |
f() |
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
<html> | |
<head> | |
<title>Title</title> | |
<script type="module" src="f1.js"></script> | |
</head> | |
<body> | |
</body> | |
<script> | |
</script> | |
</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
module.exports = { | |
entry: './example.js', | |
mode: 'development', | |
node: { | |
fs: 'empty', | |
}, | |
module: { | |
rules: [{ | |
test: /\.js$/, | |
use: { | |
loader: 'babel-loader', | |
options: { | |
presets: [ | |
'@babel/preset-env', | |
], | |
plugins: [ | |
'@babel/plugin-proposal-class-properties', | |
], | |
}, | |
}, | |
}, | |
], | |
}, | |
output: { | |
path: __dirname, | |
filename: 'gramjs.js', | |
library: 'gramjs', | |
libraryTarget: 'umd', | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment