webpack-deploy-after-build-2

    0.1.1 • Public • Published

    webpack-deploy-after-build

    Copy the dist folder to any other location after build.

    Usage

    WebPackDeployAfterBuild({ 
        from: "Directory",
        to: ["Directory1","Directory2"],
        suffixPublicPath:true,
        clearDestDir: true 
    })

    Install

    npm install --save webpack-deploy-after-build-2

    Include in webpack.config.js

    var WebPackDeployAfterBuild = require('webpack-deploy-after-build-2');

    Add plugin webpack.config.js

    var path = require('path')
    var webpack = require('webpack')
    var WebPackDeployAfterBuild = require('webpack-deploy-after-build-2');
     
    module.exports = {
     
    };
     
    if (process.env.NODE_ENV === 'production') {
        module.exports.devtool = '#source-map'
        // http://vue-loader.vuejs.org/en/workflow/production.html
        module.exports.plugins = (module.exports.plugins || []).concat([
            new webpack.DefinePlugin({
                'process.env': {
                    NODE_ENV: '"production"'
                }
            }),
            new webpack.optimize.UglifyJsPlugin({
                sourceMap: true,
                compress: {
                    warnings: false
                }
            }),
            new webpack.LoaderOptionsPlugin({
                minimize: true
            }),
            new WebPackDeployAfterBuild({
                from: path.resolve(__dirname, './dist'),
                to: ['~/Git/website/vue/']
            })
        ])
    }

    Install

    npm i webpack-deploy-after-build-2

    DownloadsWeekly Downloads

    7

    Version

    0.1.1

    License

    GPL-3.0

    Last publish

    Collaborators

    • pmb5