{"_id":"webpack-fix-default-import-plugin","_rev":"6-d39c8d166fcb149e66d5d5ccd5d8767d","name":"webpack-fix-default-import-plugin","description":"Webpack plugin to fix default import for non ES6 modules","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"webpack-fix-default-import-plugin","version":"1.0.0","description":"Webpack plugin to fix default import for non ES6 modules","main":"index.js","repository":{"type":"git","url":"git+https://github.com/sormy/webpack-fix-default-import-plugin.git"},"keywords":["webpack","plugin","typescript","default","module","export","import"],"author":{"name":"Artem Butusov","email":"art.sormy@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/sormy/webpack-fix-default-import-plugin/issues"},"homepage":"https://github.com/sormy/webpack-fix-default-import-plugin#readme","gitHead":"bb0a8c03719b08aefb57de885a8bb75636acff9b","_id":"webpack-fix-default-import-plugin@1.0.0","scripts":{},"_shasum":"1435070f96bcf3427e7bb8ad5389c8cdfee1c4d4","_from":".","_npmVersion":"3.10.4","_nodeVersion":"6.1.0","_npmUser":{"name":"sormy","email":"art.sormy@gmail.com"},"dist":{"shasum":"1435070f96bcf3427e7bb8ad5389c8cdfee1c4d4","tarball":"https://registry.npmjs.org/webpack-fix-default-import-plugin/-/webpack-fix-default-import-plugin-1.0.0.tgz","integrity":"sha512-VlVgN6+vD4Ks9ZgOaUjIh1wvLklAP2TA1V1S7CA2Hxvg1JVA4l8gFWPnWuGEpdoHY9w4Q6jvvQeTy3BOge7WOg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBobA1TxnLAtsyG+0AH3Skq1kWG3vDvZgrwxA4AR4FZBAiEAoDjytAOIwWjHzYjJXTnfTznEbVpk1L1AkFCH73W54j4="}]},"maintainers":[{"name":"sormy","email":"art.sormy@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/webpack-fix-default-import-plugin-1.0.0.tgz_1473999599353_0.9231811435893178"}},"1.0.1":{"name":"webpack-fix-default-import-plugin","version":"1.0.1","description":"Webpack plugin to fix default import for non ES6 modules","main":"index.js","repository":{"type":"git","url":"git+https://github.com/sormy/webpack-fix-default-import-plugin.git"},"keywords":["webpack","plugin","typescript","default","module","export","import"],"author":{"name":"Artem Butusov","email":"art.sormy@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/sormy/webpack-fix-default-import-plugin/issues"},"homepage":"https://github.com/sormy/webpack-fix-default-import-plugin#readme","gitHead":"021c8da150518b6f7f9b74f0b6954c06fb5e1a4f","_id":"webpack-fix-default-import-plugin@1.0.1","scripts":{},"_shasum":"ae9ecae2a0f8bd86709d1098c8891e3e7fc2f942","_from":".","_npmVersion":"3.10.4","_nodeVersion":"6.1.0","_npmUser":{"name":"sormy","email":"art.sormy@gmail.com"},"dist":{"shasum":"ae9ecae2a0f8bd86709d1098c8891e3e7fc2f942","tarball":"https://registry.npmjs.org/webpack-fix-default-import-plugin/-/webpack-fix-default-import-plugin-1.0.1.tgz","integrity":"sha512-TB16Pxn743B5Xf+0wOWplt5HX4KsEaRfwJC8e6sj/BxDjErphjF2CM4gHkyp5oD5SL85L0oT22w2obqAaOVZ8w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBdNBfVfHbHUPFuWPA/vq8PpEs3lVwJJtc6zFCvcQAoUAiEApruP1G06aPKnoysOuQN4PDBBLD7+9GnJnMmuR+jjJps="}]},"maintainers":[{"name":"sormy","email":"art.sormy@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/webpack-fix-default-import-plugin-1.0.1.tgz_1474000206003_0.6661368908826262"}},"1.0.2":{"name":"webpack-fix-default-import-plugin","version":"1.0.2","description":"Webpack plugin to fix default import for non ES6 modules","main":"index.js","repository":{"type":"git","url":"git+https://github.com/sormy/webpack-fix-default-import-plugin.git"},"keywords":["webpack","plugin","typescript","default","module","export","import"],"author":{"name":"Artem Butusov","email":"art.sormy@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/sormy/webpack-fix-default-import-plugin/issues"},"homepage":"https://github.com/sormy/webpack-fix-default-import-plugin#readme","gitHead":"5f8480a1052b0a4077542a52574ae9465a538c7f","_id":"webpack-fix-default-import-plugin@1.0.2","scripts":{},"_shasum":"141daf7e03ca14a99518cb39e1a8bc102f73b155","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"sormy","email":"art.sormy@gmail.com"},"dist":{"shasum":"141daf7e03ca14a99518cb39e1a8bc102f73b155","tarball":"https://registry.npmjs.org/webpack-fix-default-import-plugin/-/webpack-fix-default-import-plugin-1.0.2.tgz","integrity":"sha512-KaSlBN1XonoDBIrPPZh2syRyMUWVOZPcJGv9nSFqkNgCPpiaKTjDpyoNcVj9bQpZFYC5GN/mUrqDkTUrfJuoUg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGN4NfGBoHwjiBiFRMYq4zuBqz/TEVxDRIoVBOClytNpAiEA4vsP5O1gGTtKsf7cBmnARun2zZwKb+Ta6G1qJ14ZD6Q="}]},"maintainers":[{"name":"sormy","email":"art.sormy@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/webpack-fix-default-import-plugin-1.0.2.tgz_1494044573749_0.48370915255509317"}},"1.0.3":{"name":"webpack-fix-default-import-plugin","version":"1.0.3","description":"Webpack plugin to fix default import for non ES6 modules","main":"index.js","repository":{"type":"git","url":"git+https://github.com/sormy/webpack-fix-default-import-plugin.git"},"keywords":["webpack","plugin","typescript","default","module","export","import"],"author":{"name":"Artem Butusov","email":"art.sormy@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/sormy/webpack-fix-default-import-plugin/issues"},"homepage":"https://github.com/sormy/webpack-fix-default-import-plugin#readme","gitHead":"49860a75449a99960774954142d63ea58b46cf66","_id":"webpack-fix-default-import-plugin@1.0.3","scripts":{},"_shasum":"882b8e4d1aa93c48cb8fdaf846fc79d86f82f14f","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"sormy","email":"art.sormy@gmail.com"},"dist":{"shasum":"882b8e4d1aa93c48cb8fdaf846fc79d86f82f14f","tarball":"https://registry.npmjs.org/webpack-fix-default-import-plugin/-/webpack-fix-default-import-plugin-1.0.3.tgz","integrity":"sha512-qWHt9zvJ3xBjJaY5ysBLHKPEKrBLf3kZKYoPBecPPZ5m/qxBJXveFJmXlgPf8a3a8Gp8eo2BZ3vPceqc+XGsBQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAuMXAyJfMKpBwrXPel2l5KqaaCgFK0IuN3OMR00LWkuAiEA0bAdg+pJAdDDj+lU3ARl8GcuQi/o3Vw3H+oRdQBsN7c="}]},"maintainers":[{"name":"sormy","email":"art.sormy@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/webpack-fix-default-import-plugin-1.0.3.tgz_1494389700458_0.18506676610559225"}}},"readme":"# Webpack Fix Default Import Plugin #\n\n## Why? ##\n\nWith Babel transpiler you could write:\n\n```javascript\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n```\n\nIn this case Babel will be able to resolve `module.exports.default` as\n`modules.exports` if `module.exports.default` is not defined.\n\nIt doesn't work with TypeScript compiler which targets ES5, so we have to use:\n\n```javascript\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\n```\n\nOne well know workaround for this issue is to use TWO transpilers, typescript\nfirst targeted to ES6 and Babel second targeted to ES5. Extra transpilation\ntakes more time and break source maps.\n\nThe other solution is to hook into webpack's `require()` implementation and\npolyfill `module.exports.default` if it is blank and module is not ES6 module.\n\nThis plugin hooks into `require()` and try to polyfill `module.exports.default`.\n\n## Installation ##\n\n```shell\nnpm install --save-dev webpack-fix-default-import-plugin\n```\n\n`webpack.config.js` example:\n\n```javascript\nvar FixDefaultImportPlugin = require('webpack-fix-default-import-plugin');\n\nmodule.exports = {\n  ...\n  plugins: [\n    ...\n    new FixDefaultImportPlugin()\n  ],\n};\n```\n\n`tsconfig.json` example:\n\n```javascript\n{\n  \"compilerOptions\": {\n    \"sourceMap\": true,\n    \"noImplicitAny\": true,\n    \"noEmitHelpers\": true,\n    \"allowSyntheticDefaultImports\": true,   // required\n    \"module\": \"commonjs\",                   // required\n    \"target\": \"es5\",                        // required\n    \"jsx\": \"react\"\n  },\n  \"exclude\": [\n    \"node_modules\",\n    \"typings/globals\"\n  ]\n}\n```\n\n`tslint.json` example:\n\n```javascript\n{\n  ...\n  \"rules\": {\n    ...\n    \"no-unused-variable\": [true, {\"ignore-pattern\": \"^(React|ReactDOM)$\"}],\n    \"import-name\": false,\n    \"no-default-export\": false\n  }\n}\n```\n","maintainers":[{"name":"sormy","email":"art.sormy@gmail.com"}],"time":{"modified":"2022-06-28T23:52:52.925Z","created":"2016-09-16T04:20:01.330Z","1.0.0":"2016-09-16T04:20:01.330Z","1.0.1":"2016-09-16T04:30:07.790Z","1.0.2":"2017-05-06T04:22:54.587Z","1.0.3":"2017-05-10T04:15:02.387Z"},"homepage":"https://github.com/sormy/webpack-fix-default-import-plugin#readme","keywords":["webpack","plugin","typescript","default","module","export","import"],"repository":{"type":"git","url":"git+https://github.com/sormy/webpack-fix-default-import-plugin.git"},"author":{"name":"Artem Butusov","email":"art.sormy@gmail.com"},"bugs":{"url":"https://github.com/sormy/webpack-fix-default-import-plugin/issues"},"license":"MIT","readmeFilename":"readme.md"}