1. transfer-webpack-plugin
transfer files to the build directory
transfer-webpack-plugin
Package: transfer-webpack-plugin
Created by: molforp
Last modified: Mon, 27 Jun 2022 20:09:17 GMT
Version: 0.1.4
License: MIT
Downloads: 6,692
Repository: https://github.com/molforp/transfer-webpack-plugin

Install

npm install transfer-webpack-plugin
yarn add transfer-webpack-plugin

Transfer Webpack Plugin

Transfer files to the build directory

Getting started

Install the plugin:

npm install --save-dev transfer-webpack-plugin

API

 new TransferWebpackPlugin(patterns: array, [basePath: string])
  • patterns – array of patterns { from: 'path', to: 'path' }, from – relative to basePath or to context of your config (if basePath is not exists),
    to – relative to the build directory
  • basePath (optional) – directory to be resolved to from parameter

Usage

 var TransferWebpackPlugin = require('transfer-webpack-plugin');

module.exports = {
    context: path.join(__dirname, 'app'),
    plugins: [
        new TransferWebpackPlugin([
            { from: 'i18n', to: 'i18n' },
            { from: 'root' }
        ])
    ]
};

module.exports = {
    plugins: [
        new TransferWebpackPlugin([
            { from: 'i18n', to: 'i18n' },
            { from: 'root' }
        ], path.join(__dirname, 'app'))
    ]
};

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin