调整router版本

This commit is contained in:
唐明明
2022-06-17 17:10:27 +08:00
parent 7f2763a2aa
commit bbc0c351e8
31 changed files with 8816 additions and 9949 deletions

View File

@@ -1,24 +1,6 @@
const {resolve} = require('path');
const CopyPlugin = require('copy-webpack-plugin');
const webpack =require('webpack');
const cmd = require('node-cmd');
const {data:versions,err} = cmd.runSync('npm v uni-simple-router versions');
if(err){
console.log('获取线上版本失败,无法继续打包。。。')
process.exit(1);
}
let lastVersion='';
const list=JSON.parse(versions.replace(/'/g,'"')).reverse();
for(let i=0;i<list.length;i++){
if (!/[A-Za-z]/g.test(list[i])) {
lastVersion=list[i];
break;
}
}
module.exports = {
entry: './src/index.ts',
@@ -48,18 +30,12 @@ module.exports = {
force: true,
from: resolve(__dirname, '../src/component'),
to: resolve(__dirname, '../dist'),
}
},
]),
new webpack.DefinePlugin({
$npm_package_name: webpack.DefinePlugin.runtimeValue(() => {
return JSON.stringify(process.env.npm_package_name.toLocaleUpperCase())
}, true ),
$npm_package_version: webpack.DefinePlugin.runtimeValue(() => {
return JSON.stringify(process.env.npm_package_version.toLocaleUpperCase())
}, true ),
$npm_package_last_version: webpack.DefinePlugin.runtimeValue(() => {
return JSON.stringify(lastVersion)
}, true ),
}, true )
})
],
};