ncmp-copy-plugindeprecated

NCMP plugin for copying files

Usage no npm install needed!

<script type="module">
  import ncmpCopyPlugin from 'https://cdn.skypack.dev/ncmp-copy-plugin';
</script>

README

ncmp-copy-plugin

Deprecated - Not actively maintained!!

NPM David bitHound Overall Score Join the chat at https://gitter.im/ncmp/ncmp

NCMP plugin for copying files from node_modules into another file structure.

Installation

npm install ncmp-copy-plugin

Usage

Use this to copy files which are runtime dependencies of your client application to another folder structure outside of node_modules.

You have to extend the ncmp.json configuration file as described below:

{
    "destinations": {
        "*.css": "content/components",
        "aurelia-*.js": "scripts/components/aurelia/*",
        "*": "scripts/components",
    },
    "plugins": ["copy"]
}

Add the word "copy" to the correct position in the "plugins" array.

It defines the destination folders depending on a regular expression which is executed against the file basename. The base path is the root folder. In this example we want to copy the distributions from jquery. The tool will perform the following copy actions:

Source Destination
./node_modules/jquery/dist/jquery.js ./scripts/components/jquery.js
./node_modules/jquery/dist/jquery.min.js ./scripts/components/jquery.min.js
./node_modules/aurelia-framework/dist/amd/aurelia-framework.js ./scripts/components/aurelia/framework/aurelia-framework.js
./node_modules/aurelia-templating/dist/amd/aurelia-templating.js ./scripts/components/aurelia/templating/aurelia-templating.js

You can also define a single source file instead of an array. Files are only copied if they does not exists in the destination or the file hash differs.

You can use globs everywhere in the source file paths:

dist/*.js
dist/jquery.*
dist/*.min.js

See main documentation for additional information.

License

MIT