[parser] Fixed issue with package.json created by npm run webpack-npm
@@ -32,18 +32,11 @@ const defaultConfig = Object.assign({}, require('./webpack.config'), {
plugins: []
});
-const npmSetupConfig = {
- entry: {
- 'package.json': './package.json'
- },
- output: {
- path: DIST_DIR,
- filename: 'package.json'
- },
- plugins: [
+const npmSetupPlugins = [
new CleanWebpackPlugin([DIST_DIR]),
new CopyWebpackPlugin({
patterns: [
+ { from: './package.json', to: `${DIST_DIR}/package.json` },
{ from: './NPM-README.md', to: `${DIST_DIR}/README.md` },
{ from: `${JS_ROOT}/components`, to: `${DIST_DIR}/src/components` },
@@ -53,8 +46,7 @@ const npmSetupConfig = {
{ from: `${JS_ROOT}/sql`, to: `${DIST_DIR}/src/sql` }
]
})
- ]
-};
+];
const webComponentsConfig = Object.assign({}, defaultConfig, {
entry: {
@@ -63,9 +55,7 @@ const webComponentsConfig = Object.assign({}, defaultConfig, {
output: {
path: `${DIST_DIR}/components`
},
- plugins: [
- new VueLoaderPlugin()
- ]
+ plugins: npmSetupPlugins.concat(new VueLoaderPlugin())
});
const parserConf = Object.assign({}, defaultConfig, {
@@ -114,7 +104,6 @@ const parserConf = Object.assign({}, defaultConfig, {
});
module.exports = [
- npmSetupConfig,
webComponentsConfig,
parserConf
];
\ No newline at end of file
