Using npm:
$ npm install webpack-move-files-after-compile-plugin --save-dev
Using yarn:
$ yarn add webpack-move-files-after-compile-plugin --dev
- Require
webpack-move-files-after-compile-plugin
:
const WebpackMoveFilesAfterCompilePlugin = require('webpack-move-files-after-compile-plugin');
- Add to webpack config:
Required params: path relative to the root directory;
-
moveFrom
- the path to the directory from which you want to move files; -
moveTo
- the path to the directory where you want to move the files; This directory should not be used to store other files. It is cleared at each compilation before new files are written. If the destination directory does not exist, it will be created automatically.
const config = {
plugins: [
new WebpackMoveFilesAfterCompilePlugin({
moveFrom: 'dist/path',
moveTo: 'source-maps'
})
]
}
regexForMove
- regex to determine, which files to move. Default:/\.map$/
;
const config = {
plugins: [
new WebpackMoveFilesAfterCompilePlugin({
moveFrom: 'dist/path',
moveTo: 'source-maps',
regexForMove: /\.js$/
})
]
}
npm test
: Runs the test suitenpm start lint
: Runs linting