Skip to content

Instantly share code, notes, and snippets.

@antonmedv
Created May 18, 2017 06:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonmedv/2ca413337813619ab34970ead003c8d7 to your computer and use it in GitHub Desktop.
Save antonmedv/2ca413337813619ab34970ead003c8d7 to your computer and use it in GitHub Desktop.
CoffeeScript with Tree Shaking
export foo = 'foo'
export unused = -> foo
import {foo} from './foo.coffee'
console.log foo
{
"dependencies": {
"coffee-loader": "^0.7.3",
"coffee-script": "^1.12.6",
"webpack": "^2.5.1"
}
}
module.exports = {
entry: './index.coffee',
output: {
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.coffee$/,
use: [ 'coffee-loader' ]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment