{"_id":"shim-loader","_rev":"6-6356d826c51545c0d14edeb46cc63a48","name":"shim-loader","description":"makes traditional/legacy scripts compatible with webpack","dist-tags":{"latest":"1.0.1"},"versions":{"0.1.0":{"name":"shim-loader","version":"0.1.0","description":"makes traditional/legacy scripts compatible with webpack","main":"lib/shimLoader.js","files":["*.md","src","lib"],"scripts":{"clean-lib":"del-cli \".lib/**\"","clean-tmp":"del-cli \".tmp/**\"","build":"npm run clean-lib && babel ./src -d lib","test":"npm run clean-tmp && mocha --timeout 2000 --compilers js:babel-register test/test.js","cover":"cross-env BABEL_ENV=coverage nyc --reporter=lcov --reporter=text npm test"},"repository":{"type":"git","url":"git+https://github.com/zinserjan/shim-loader.git"},"bugs":{"url":"https://github.com/zinserjan/shim-loader/issues"},"keywords":["webpack","shim","loader"],"author":{"name":"Jan-André Zinser"},"license":"MIT","devDependencies":{"babel-cli":"^6.11.4","babel-loader":"^6.2.4","babel-plugin-istanbul":"^1.0.3","babel-preset-es2015":"^6.13.2","babel-preset-es2015-script":"^1.0.0","babel-register":"^6.11.6","cross-env":"^2.0.0","del-cli":"^0.2.0","mocha":"^3.0.1","nyc":"^7.1.0","webpack":"^1.13.1"},"dependencies":{"loader-utils":"^0.2.15","lodash":"^4.14.1","precond":"^0.2.3","webpack-sources":"^0.1.2"},"nyc":{"include":["src/**/*.js"],"sourceMap":false,"instrument":false},"gitHead":"ac3e25383d86a371285fb8905d3e0a5a796ea1ad","homepage":"https://github.com/zinserjan/shim-loader#readme","_id":"shim-loader@0.1.0","_shasum":"bc3bb21ac93c5f8f3fa9eed90a3673ca291aa387","_from":".","_npmVersion":"3.7.2","_nodeVersion":"4.2.4","_npmUser":{"name":"zinserjan","email":"zinserjan@gmail.com"},"dist":{"shasum":"bc3bb21ac93c5f8f3fa9eed90a3673ca291aa387","tarball":"https://registry.npmjs.org/shim-loader/-/shim-loader-0.1.0.tgz","integrity":"sha512-BYDTCtr3wS9x4eRPWkl8v+A/99JLLdzkK0f2V1mAxTOTsLMZaf7pUeY2/T7w/WFDG+boHaowclwIEzxa91AHrw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHqLHbYgNZB9V1y589hR3ID+NKu0m7INmjx1Pz5ZEGwlAiBOXxGSqJAo4zPRVEC5RamMkqUFSGmV3PxE5P/vSL1DBg=="}]},"maintainers":[{"name":"zinserjan","email":"zinserjan@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/shim-loader-0.1.0.tgz_1472586230735_0.0475434681866318"}},"1.0.0":{"name":"shim-loader","version":"1.0.0","description":"makes traditional/legacy scripts compatible with webpack","main":"lib/shimLoader.js","files":["*.md","src","lib"],"scripts":{"clean-lib":"del-cli \".lib/**\"","clean-tmp":"del-cli \".tmp/**\"","build":"npm run clean-lib && babel ./src -d lib","test":"npm run clean-tmp && mocha --timeout 2000 --compilers js:babel-register test/test.js","cover":"cross-env BABEL_ENV=coverage nyc --reporter=lcov --reporter=text npm test"},"repository":{"type":"git","url":"git+https://github.com/zinserjan/shim-loader.git"},"bugs":{"url":"https://github.com/zinserjan/shim-loader/issues"},"keywords":["webpack","shim","loader"],"author":{"name":"Jan-André Zinser"},"license":"MIT","devDependencies":{"babel-cli":"^6.11.4","babel-loader":"^6.2.4","babel-plugin-istanbul":"^1.0.3","babel-preset-es2015":"^6.13.2","babel-preset-es2015-script":"^1.0.0","babel-register":"^6.11.6","cross-env":"^2.0.0","del-cli":"^0.2.0","mocha":"^3.0.1","nyc":"^7.1.0","webpack":"^1.13.1"},"dependencies":{"loader-utils":"^1.1.0","lodash":"^4.14.1","precond":"^0.2.3","webpack-sources":"^0.2.3"},"nyc":{"include":["src/**/*.js"],"sourceMap":false,"instrument":false},"gitHead":"11784c746cc6f9faa1dd35d332e0910814ff70a5","homepage":"https://github.com/zinserjan/shim-loader#readme","_id":"shim-loader@1.0.0","_shasum":"02e410704cfa3048e6995c96471326daf75b1cad","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"zinserjan","email":"zinserjan@gmail.com"},"dist":{"shasum":"02e410704cfa3048e6995c96471326daf75b1cad","tarball":"https://registry.npmjs.org/shim-loader/-/shim-loader-1.0.0.tgz","integrity":"sha512-K4Nri0Ne/96H4uPE+rqqHwxiEdjZg8nSP2AEeay77SU+dCIq3bxqZu4auu1e40/X/3YLnPZ0MSXTM8+1qcL5HA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFrDSbhCl97hM/vWiTIcFeXT5ogIDcoT01cSwDICCjkwAiA+Cf/3enelmF1L2yrAXnDrQeTv86aP+YvJM7bM2IQvdg=="}]},"maintainers":[{"name":"zinserjan","email":"zinserjan@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/shim-loader-1.0.0.tgz_1494446201033_0.6191063069272786"}},"1.0.1":{"name":"shim-loader","version":"1.0.1","description":"makes traditional/legacy scripts compatible with webpack","main":"lib/shimLoader.js","files":["*.md","src","lib"],"scripts":{"clean-lib":"del-cli \".lib/**\"","clean-tmp":"del-cli \".tmp/**\"","build":"npm run clean-lib && babel ./src -d lib","test":"npm run clean-tmp && mocha --timeout 2000 --compilers js:babel-register test/test.js","cover":"cross-env BABEL_ENV=coverage nyc --reporter=lcov --reporter=text npm test","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/zinserjan/shim-loader.git"},"bugs":{"url":"https://github.com/zinserjan/shim-loader/issues"},"keywords":["webpack","shim","loader"],"author":{"name":"Jan-André Zinser"},"license":"MIT","devDependencies":{"babel-cli":"^6.11.4","babel-loader":"^6.2.4","babel-plugin-istanbul":"^1.0.3","babel-preset-es2015":"^6.13.2","babel-preset-es2015-script":"^1.0.0","babel-register":"^6.11.6","cross-env":"^2.0.0","del-cli":"^0.2.0","mocha":"^3.0.1","nyc":"^7.1.0","webpack":"^1.13.1"},"dependencies":{"loader-utils":"^1.1.0","lodash":"^4.14.1","precond":"^0.2.3","webpack-sources":"^0.2.3"},"nyc":{"include":["src/**/*.js"],"sourceMap":false,"instrument":false},"gitHead":"87125c6054338b88eae5567c58979f636d8ee63d","homepage":"https://github.com/zinserjan/shim-loader#readme","_id":"shim-loader@1.0.1","_shasum":"2583a6d2aa938897c2a41658bcef73ec87d3aa5e","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"zinserjan","email":"zinserjan@gmail.com"},"dist":{"shasum":"2583a6d2aa938897c2a41658bcef73ec87d3aa5e","tarball":"https://registry.npmjs.org/shim-loader/-/shim-loader-1.0.1.tgz","integrity":"sha512-O7amY2FR6Mmu0LRair5uLc/NG/sHFw/ulOf9s4iJfW/4KBSQdyqz9iZmOf57QG7xbKISHHPttMsVZWqQ/0vxpw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBCBdsxiqq5xpbplSiiFU0cjSCyn4TlKqvV7nkKjimeLAiEAkngh+WKjpAWpA2OLld9TklRcgzy2gr/Y5tqbfc9Pu2A="}]},"maintainers":[{"name":"zinserjan","email":"zinserjan@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/shim-loader-1.0.1.tgz_1495046797970_0.269082440296188"}}},"readme":"# shim-loader [![npm package][npm-badge]][npm] [![Build Status][build-badge]][build] [![codecov][codecov-badge]][codecov]\n\nshim-loader makes traditional/legacy \"browser globals\" scripts compatible with webpack's module system. Based on the idea of [RequireJS](http://requirejs.org/docs/api.html#config-shim) and [browserify-shim](https://github.com/thlorenz/browserify-shim).\n\nShimming in webpack is already possible with [complicated configurations](https://github.com/webpack/docs/wiki/shimming-modules). Now it's easy!\n\n\n## Features\n\n  - Shims non-CommonJS modules by specifying an alias and the identifier under which the module attaches itself to the global window object. Optionally you can specify the path to the module.\n  - set up code relationships when libraries depends on other libraries being in the global namespace.\n  - Makes *define* and also *module* be undefined, in order to fix improperly-authored libraries that need shimming but try anyway to use AMD or CommonJS.\n\n## When should I use this?\nYou should use this only when you have to use libraries that are incompatible with your desired module definition style or when you want to upgrade a legacy project to the present.\n\n## How does it work?\nshim-loader is a webpack loader that transforms the code in a way that it works in the webpack environment. It's nearly the same as doing this manually with [imports-loader](https://github.com/webpack/imports-loader) and [exports-loader](https://github.com/webpack/exports-loader).\n\n## Installation\n\n```bash\n\n$ npm install shim-loader --save-dev\n\n```\nInstall shim-loader via npm and add the loader to your webpack config.\n\n\n## Configuration\n\n\n**webpack.config.js**\n```javascript\n\nvar path = require('path');\n\nvar webpackShimConfig = {\n  // Remember: Only use shim config for incompatible libraries\n  // the libraries below are just examples, regardless whether they are compatible or not\n  shim: {\n    'jquery': {\n      exports: 'jQuery' // Once loaded, use the global 'jQuery' as the module value.\n    },\n    'underscore': {\n      exports: '_' // Once loaded, use the global '_' as the module value.\n    },\n    'backbone': {\n      exports: 'Backbone' // Once loaded, use the global 'Backbone' as the module value.\n      deps: [\n        'underscore', // just make sure that underscore is loaded before (uses it's global value)\n        'jquery:$', // Provide jquery as dependency with name $\n      ]\n    },\n    'jquery.ui.core': {\n      deps: [\n        'jquery:jQuery', // Provide jquery as dependency with name jQuery\n      ]\n    },\n    'jquery.ui.datepicker': {\n      deps: [\n        'jquery:jQuery', // Provide jquery as dependency with name jQuery\n        'jquery.ui.core', // just make sure that jquery.ui.core is loaded before\n      ]\n    },\n    'math': {\n      // multiple export values are also possible,\n      // they are returned as single object with the associated key for each value\n      // e.g. module.exports = { add: function(){}, subtract: function(){} };\n      exports: [\n        'add', // exports add from global namespace as module value\n        'subtract',  // exports subtract from global namespace as module value\n      ]\n    },\n    // absolute paths are also possible\n    [path.join(__dirname, 'bower_components/jquery-ui/ui/datepicker.js')]: {\n      deps: [\n          'jquery:jQuery', // Provide jquery as dependency with name jQuery\n          'jquery.ui.core', // just make sure that jquery.ui.core is loaded before\n        ]\n    }\n  },\n  'masonry': {\n      amd: false // disable AMD module style\n      commonjs: true // and use CommonJS module style instead\n  }\n};\n\nmodule.exports = {\n  entry: './src/app.js',\n  output: {\n    path: './dist',\n    filename: 'bundle.js',\n  },\n  resolve: {\n    alias: {\n      'jquery': path.join(__dirname, 'bower_components/jquery/dist/jquery.js'),\n      'underscore': path.join(__dirname, 'bower_components/lodash/dist/lodash.underscore.js'),\n      'backbone': path.join(__dirname, 'bower_components/backbone/backbone.js'),\n      'jquery.ui.core': path.join(__dirname, 'bower_components/jquery-ui/ui/core.js'),\n      'jquery.ui.datepicker': path.join(__dirname, 'bower_components/jquery-ui/ui/datepicker.js'),\n    },\n  },\n  module: {\n    loaders: [\n      {\n        // apply the loader to setup module shimming\n        test: /\\.js/\n        loader: 'shim-loader',\n        query: webpackShimConfig,\n        // pass a list of directories or files to improve performance\n        includes:  path.join(__dirname, 'bower_components'),\n      }\n    ]\n  },\n};\n\n```\n\n## License\n\nMIT\n\n\n[npm-badge]: https://img.shields.io/npm/v/shim-loader.svg?style=flat-square\n[npm]: https://www.npmjs.org/package/shim-loader\n[build-badge]:https://travis-ci.org/zinserjan/shim-loader.svg?branch=master\n[build]: https://travis-ci.org/zinserjan/shim-loader\n[codecov-badge]:https://codecov.io/gh/zinserjan/shim-loader/branch/master/graph/badge.svg\n[codecov]: https://codecov.io/gh/zinserjan/shim-loader\n","maintainers":[{"name":"zinserjan","email":"zinserjan@gmail.com"}],"time":{"modified":"2022-06-26T18:52:41.740Z","created":"2016-08-30T19:43:52.332Z","0.1.0":"2016-08-30T19:43:52.332Z","1.0.0":"2017-05-10T19:56:42.961Z","1.0.1":"2017-05-17T18:46:38.841Z"},"homepage":"https://github.com/zinserjan/shim-loader#readme","keywords":["webpack","shim","loader"],"repository":{"type":"git","url":"git+https://github.com/zinserjan/shim-loader.git"},"author":{"name":"Jan-André Zinser"},"bugs":{"url":"https://github.com/zinserjan/shim-loader/issues"},"license":"MIT","readmeFilename":"README.md","users":{"tecktron":true}}