{"name":"coffee-loader","version":"0.9.0","author":{"name":"Tobias Koppers @sokra"},"description":"coffee loader module for webpack","files":["index.js"],"scripts":{"release":"standard-version"},"dependencies":{"loader-utils":"^1.0.2"},"devDependencies":{"standard-version":"^4.2.0"},"peerDependencies":{"coffeescript":">= 1.8.x"},"homepage":"http://github.com/webpack-contrib/coffee-loader","repository":{"type":"git","url":"git+ssh://git@github.com/webpack-contrib/coffee-loader.git"},"license":"MIT","gitHead":"fc0d9aac1523a8742d65551f15f78b673e7ba6b0","bugs":{"url":"https://github.com/webpack-contrib/coffee-loader/issues"},"_id":"coffee-loader@0.9.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"d3viant0ne","email":"wiens.joshua@gmail.com"},"dist":{"integrity":"sha512-VSoQ5kWr6Yfjn4RDpVbba2XMs3XG1ZXtLakPRt8dNfUcNU9h+1pocpdUUEd7NK9rLDwrju4yonhxrL8aMr5tww==","shasum":"6deabd336062ddc6d773da4dfd16367fc7107bd6","tarball":"http://registry-npm.ywwl.com/coffee-loader/download/coffee-loader-0.9.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHFTU1XrUtGjkI+065OfPIvc2//BVMWA1zYlSdWwifV6AiEAu6H05F//IG1HiHHWS0FRNvamhD8jYsATboQ+kGeLSlQ="}],"size":3367,"noattachment":false,"key":"/coffee-loader/-/coffee-loader-0.9.0.tgz"},"maintainers":[{"email":"eric@smarterspam.com","name":"ericclemmons"},{"email":"wiens.joshua@gmail.com","name":"d3viant0ne"},{"email":"bebraw@gmail.com","name":"bebraw"},{"email":"mail@johannesewald.de","name":"jhnns"},{"email":"sean.larkin@cuw.edu","name":"thelarkinn"},{"email":"tobias.koppers@googlemail.com","name":"sokra"},{"email":"j.tangelder@gmail.com","name":"jtangelder"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-loader-0.9.0.tgz_1508904882844_0.8935025460086763"},"directories":{},"readme":"<div align=\"center\">\n  <img width=\"160\" height=\"160\" src=\"https://cdn.worldvectorlogo.com/logos/coffeescript.svg\">\n  <a href=\"https://github.com/webpack/webpack\">\n    <img width=\"200\" height=\"200\" hspace=\"20\" src=\"https://webpack.js.org/assets/icon-square-big.svg\">\n  </a>\n</div>\n\n[![npm][npm]][npm-url]\n[![node][node]][node-url]\n[![tests][tests]][tests-url]\n[![coverage][cover]][cover-url]\n[![discussion][discussion]][discussion-url]\n[![size][size]][size-url]\n\n# coffee-loader\n\nCompile [CoffeeScript](https://coffeescript.org/) to JavaScript.\n\n## Getting Started\n\nTo begin, you'll need to install `coffeescript` and `coffee-loader`:\n\n```console\nnpm install --save-dev coffeescript coffee-loader\n```\n\nor\n\n```console\nyarn add -D coffeescript coffee-loader\n```\n\nor\n\n```console\npnpm add -D coffeescript coffee-loader\n```\n\nThen add the plugin to your `webpack` config. For example:\n\n**file.coffee**\n\n```coffee\n# Assignment:\nnumber   = 42\nopposite = true\n\n# Conditions:\nnumber = -42 if opposite\n\n# Functions:\nsquare = (x) -> x * x\n\n# Arrays:\nlist = [1, 2, 3, 4, 5]\n\n# Objects:\nmath =\n  root:   Math.sqrt\n  square: square\n  cube:   (x) -> x * square x\n\n# Splats:\nrace = (winner, runners...) ->\n  print winner, runners\n\n# Existence:\nalert \"I knew it!\" if elvis?\n\n# Array comprehensions:\ncubes = (math.cube num for num in list)\n```\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.coffee$/,\n        loader: \"coffee-loader\",\n      },\n    ],\n  },\n};\n```\n\nAlternative usage:\n\n```js\nimport coffee from \"coffee-loader!./file.coffee\";\n```\n\nAnd run `webpack` via your preferred method.\n\n## Options\n\nType: `Object`\nDefault: `{ bare: true }`\n\nOptions for CoffeeScript. All possible options you can find [here](https://coffeescript.org/#nodejs-usage).\n\nDocumentation for the `transpile` option you can find [here](https://coffeescript.org/#transpilation).\n\n> **Note**\n>\n> The `sourceMap` option takes a value from the `compiler.devtool` value by default.\n\n> **Note**\n>\n> The `filename` option takes a value from webpack loader API. The option value will be ignored.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.coffee$/,\n        loader: \"coffee-loader\",\n        options: {\n          bare: false,\n          transpile: {\n            presets: [\"@babel/env\"],\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n## Examples\n\n### CoffeeScript and Babel\n\nFrom CoffeeScript 2 documentation:\n\n> **Note**\n>\n> CoffeeScript 2 generates JavaScript that uses the latest, modern syntax.\n> The runtime or browsers where you want your code to run might not support all of that syntax.\n> In that case, we want to convert modern JavaScript into older JavaScript that will run in older versions of Node or older browsers; for example, `{ a } = obj` into `a = obj.a`.\n> This is done via transpilers like Babel, Bublé or Traceur Compiler.\n\nYou'll need to install `@babel/core` and `@babel/preset-env` and then create a configuration file:\n\n```console\nnpm install --save-dev @babel/core @babel/preset-env\necho '{ \"presets\": [\"@babel/env\"] }' > .babelrc\n```\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.coffee$/,\n        loader: \"coffee-loader\",\n        options: {\n          transpile: {\n            presets: [\"@babel/env\"],\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n### Literate CoffeeScript\n\nFor using Literate CoffeeScript you should setup:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.coffee$/,\n        loader: \"coffee-loader\",\n        options: {\n          literate: true,\n        },\n      },\n    ],\n  },\n};\n```\n\n## Contributing\n\nPlease take a moment to read our contributing guidelines if you haven't yet done so.\n\n[CONTRIBUTING](./.github/CONTRIBUTING.md)\n\n## License\n\n[MIT](./LICENSE)\n\n[npm]: https://img.shields.io/npm/v/coffee-loader.svg\n[npm-url]: https://npmjs.com/package/coffee-loader\n[node]: https://img.shields.io/node/v/coffee-loader.svg\n[node-url]: https://nodejs.org\n[tests]: https://github.com/webpack-contrib/coffee-loader/workflows/coffee-loader/badge.svg\n[tests-url]: https://github.com/webpack-contrib/coffee-loader/actions\n[cover]: https://codecov.io/gh/webpack-contrib/coffee-loader/branch/master/graph/badge.svg\n[cover-url]: https://codecov.io/gh/webpack-contrib/coffee-loader\n[discussion]: https://img.shields.io/github/discussions/webpack/webpack\n[discussion-url]: https://github.com/webpack/webpack/discussions\n[size]: https://packagephobia.now.sh/badge?p=coffee-loader\n[size-url]: https://packagephobia.now.sh/result?p=coffee-loader\n","publish_time":1508904883745,"_cnpm_publish_time":1508904883745,"dist-tags":{"latest":"5.0.4"}}