{"id":25376770,"url":"https://github.com/terrierscript/downgrade-webpack-loader-config","last_synced_at":"2025-10-30T08:31:30.789Z","repository":{"id":57119039,"uuid":"75936903","full_name":"terrierscript/downgrade-webpack-loader-config","owner":"terrierscript","description":null,"archived":false,"fork":false,"pushed_at":"2017-03-14T22:52:26.000Z","size":19,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-11T07:16:04.161Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terrierscript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-08T12:45:35.000Z","updated_at":"2017-09-19T15:00:04.000Z","dependencies_parsed_at":"2022-08-26T13:31:10.722Z","dependency_job_id":null,"html_url":"https://github.com/terrierscript/downgrade-webpack-loader-config","commit_stats":null,"previous_names":["inuscript/degrate-webpack-loader-config","inuscript/downgrade-webpack-loader-config"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terrierscript%2Fdowngrade-webpack-loader-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terrierscript%2Fdowngrade-webpack-loader-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terrierscript%2Fdowngrade-webpack-loader-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terrierscript%2Fdowngrade-webpack-loader-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terrierscript","download_url":"https://codeload.github.com/terrierscript/downgrade-webpack-loader-config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238249323,"owners_count":19440891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-15T04:39:18.135Z","updated_at":"2025-10-30T08:31:25.434Z","avatar_url":"https://github.com/terrierscript.png","language":"JavaScript","readme":"# downgrade-webpack-loader-config\n\n\u003e Downgrade webpack v2 config to v1 loadable\n\n## Install\n\n```\n$ npm install -D downgrade-webpack-loader-config\n```\n\n## Use case (When I use this package?)\n\n* Prepare for upgrade webpack v2.\n* Some sub tools compatibility (i.e. storybook)\n\n## Exmaple\n\n### Usage\n\n```js\nconst downgrade = require('downgrade-webpack-loader-config')\nconst webpack2Conf = require('../webpack.config') // webpack v2 config\nconst loaderConf = downgrade(webpack2Conf.module.rules)\n\n// webpack v1 compatible config\nmodule.exports = {\n  module: loaderConf,\n}\n```\n\n### Input / Output\n\n```js\nconst downgrade = require('downgrade-webpack-loader-config')\n\nconst v2Config = [\n  {\n    test: /.js?$/,\n    use: ['babel-loader'],\n    exclude: /node_modules/\n  },\n  {\n    test: /.js?$/,\n    enforce: \"post\",\n    use: ['eslint-loader'],\n  },\n  {\n    test: /\\.css$/,\n    use: [\n      { loader: 'style-loader' },\n      { loader: 'css-loader', options: { modules: true } },\n      { loader: 'postcss-loader' }\n    ]\n  },\n  {\n    test: /\\.(png|jpeg|svg)$/,\n    use: [\n      \"url-loader\"\n    ]\n  }\n]\n\nconst output = downgrade(v2Config)\n\nassert.deepEqual(output, {\n  loaders: [\n    { test: /.js?$/, loader: 'babel-loader' },\n    { test: /\\.css$/, loader: 'style-loader' },\n    { test: /\\.css$/,\n      loader: 'css-loader',\n      query: { modules: true }\n    },\n    { test: /\\.css$/, loader: 'postcss-loader' },\n    { test: /\\.(png|jpeg|svg)$/, loader: 'url-loader' }\n  ],\n  \"postLoaders\": [\n    { \"test\": /.js?$/, \"loader\": \"eslint-loader\" }\n  ]\n})\n// =\u003e assert OK\n```\n\n## References\n\n* https://webpack.js.org/guides/migrating/#module-loaders-is-now-module-rules","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterrierscript%2Fdowngrade-webpack-loader-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterrierscript%2Fdowngrade-webpack-loader-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterrierscript%2Fdowngrade-webpack-loader-config/lists"}