@k88/module-scope-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

@k88/module-scope-plugin

A Webpack plugin forked from create-react-app that prevents users from importing from outside of src/ and node_modules/ directory. Taken from react-dev-utils, but is published as a standalone plugin and has Typescript definition.

Installation

Install using

npm install @k88/module-scope-plugin

Usage

Add this plugin to the resolve key of Webpack:

const ModuleScopePlugin = require('@k88/ModuleScopePlugin');
module.exports = {
  ...webpackConfig,
  resolve: {
      /* other resolve configs */
      plugins: [
          new ModuleScopePlugin(APP_SOURCE_PATH, [ OTHER_PATHS, PACKAGE_JSON_PATH ]),
      ],
  },
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    7,391
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    7,391
  • 1.0.3
    16
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i @k88/module-scope-plugin

Weekly Downloads

7,407

Version

1.1.0

License

ISC

Unpacked Size

9.27 kB

Total Files

6

Last publish

Collaborators

  • ktalebian