{"_id":"coffee-loader@5.0.4","bugs":{"url":"https://github.com/webpack/coffee-loader/issues"},"dist":{"shasum":"30fd34d446a7cd10bb2266efa4098dd600762080","tarball":"http://registry-npm.ywwl.com/coffee-loader/download/coffee-loader-5.0.4.tgz","fileCount":7,"integrity":"sha512-PgZGToSwRfy5mewxgpwvQsF/VoT9tUuEY8a/ixknhzMSl+7Cg4tnwClFppzpPkDLNH4W98ia8+8XNPqKvPkOzA==","signatures":[{"sig":"MEUCIQDDmg83c1jG4CUHP/sscFCzFZF1fqHNTlHeLorXre9kVwIgHltdoZp3LfnF7uLuIsS6yvsHE2kDzS9th4b6DgohEHc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD0HqnfPO91vo0KuQ6usKxklkyaZtKUhXSXBiUezCxaqQIhAMV89YXT36e8iYpmELhdw1UVL8rjVDcfeMH5lDHXYK9T"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/coffee-loader@5.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":10171,"size":4161,"noattachment":false,"key":"/coffee-loader/-/coffee-loader-5.0.4.tgz"},"main":"dist/cjs.js","name":"coffee-loader","author":{"name":"Tobias Koppers @sokra"},"engines":{"node":">= 18.12.0"},"funding":{"url":"https://opencollective.com/webpack","type":"opencollective"},"gitHead":"a38801041388f7e4607d5b390eec0f39efea4911","license":"MIT","scripts":{"fix":"npm-run-all -l fix:js fix:prettier","lint":"npm-run-all -l -p \"lint:**\"","test":"npm run test:coverage","build":"cross-env NODE_ENV=production babel src -d dist --copy-files","clean":"del-cli dist","start":"npm run build -- -w","fix:js":"npm run lint:js -- --fix","lint:js":"eslint --cache .","prepare":"husky && npm run build","pretest":"npm run lint","release":"changeset publish","prebuild":"npm run clean","security":"npm audit --production","changeset":"changeset","test:only":"cross-env NODE_ENV=test jest","commitlint":"commitlint --from=main","test:watch":"npm run test:only -- --watch","fix:prettier":"npm run lint:prettier -- --write","lint:prettier":"prettier --list-different .","lint:spelling":"cspell --no-must-find-files --cache --quiet \"**/*.*\"","test:coverage":"npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage","version-packages":"changeset version"},"version":"5.0.4","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"a29b2236-caa0-4dfb-93e0-bf700225adaa"}},"homepage":"https://github.com/webpack/coffee-loader","keywords":["webpack"],"repository":{"url":"git+https://github.com/webpack/coffee-loader.git","type":"git"},"_npmVersion":"12.2.0","description":"coffee loader module for webpack","directories":{},"maintainers":[{"name":"evilebottnawi","email":"sheo13666q@gmail.com"},{"name":"sokra","email":"tobias.koppers@googlemail.com"},{"name":"jhnns","email":"mail@johannesewald.de"},{"name":"15000621931","email":"784487301@qq.com"},{"name":"ev1stensberg","email":"evenstensberg@gmail.com"},{"name":"__hai","email":"haijie0619@gmail.com"},{"name":"avivkeller","email":"me@aviv.sh"}],"_nodeVersion":"24.21.0","_hasShrinkwrap":false,"devDependencies":{"del":"^7.1.0","jest":"^30.0.0","husky":"^9.1.3","memfs":"^4.9.3","cspell":"^8.9.1","eslint":"^9.30.1","del-cli":"^5.1.0","globals":"^16.3.0","webpack":"^5.92.1","prettier":"^3.3.2","cross-env":"^7.0.3","@babel/cli":"^7.24.7","@eslint/js":"^9.32.0","babel-jest":"^30.0.0","@babel/core":"^7.24.7","lint-staged":"^15.2.7","npm-run-all":"^4.1.5","coffeescript":"^2.7.0","@changesets/cli":"^2.31.1","@commitlint/cli":"^19.3.0","eslint-plugin-n":"^17.21.0","@eslint/markdown":"^7.1.0","@babel/preset-env":"^7.24.7","eslint-plugin-jest":"^29.0.1","eslint-plugin-import":"^2.32.0","eslint-config-webpack":"^4.3.0","eslint-plugin-unicorn":"^60.0.0","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.5.3","@stylistic/eslint-plugin":"^5.2.2","@commitlint/config-conventional":"^19.2.2"},"peerDependencies":{"webpack":"^5.0.0","coffeescript":">= 2.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/coffee-loader_5.0.4_1791981841265_0.4118615312188374"},"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 loader to your `webpack.config.js`. 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\nFinally, run `webpack` using the method you normally use (e.g., via CLI or an npm script).\n\n## Options\n\nType: `Object`\nDefault: `{ bare: true }`\n\nYou can find all available CoffeeScript options [here](https://coffeescript.org/#nodejs-usage).\n\nFor documentation on the `transpile` option, see [this section](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, but it's 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 using 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, modern JavaScript needs to be converted into an older JavaScript that will run in older versions of Node or older browsers; for example: `{ a } = obj` into `a = obj.a`.\n> This conversion is done using 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\nTo use 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](https://github.com/webpack/coffee-loader?tab=contributing-ov-file#contributing) if you haven't yet done so.\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/coffee-loader/workflows/coffee-loader/badge.svg\n[tests-url]: https://github.com/webpack/coffee-loader/actions\n[cover]: https://codecov.io/gh/webpack/coffee-loader/branch/main/graph/badge.svg\n[cover-url]: https://codecov.io/gh/webpack/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":1791981841358,"_cnpm_publish_time":1791981841358,"dist-tags":{"latest":"5.0.4"}}