2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-23 03:30:35 +03:00

修改config

This commit is contained in:
mxie
2018-01-17 14:06:21 +08:00
parent dd9e90d840
commit ec05fc591d
7 changed files with 79 additions and 38 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -6,6 +6,6 @@
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
<script src="dist/build.js"></script> <script src="demo/build.js"></script>
</body> </body>
</html> </html>
+10 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "vue2-datepicker", "name": "vue2-datepicker",
"version": "1.7.0", "version": "1.8.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@@ -7955,6 +7955,15 @@
} }
} }
}, },
"webpack-merge": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.1.1.tgz",
"integrity": "sha512-geQsZ86YkXOVOjvPC5yv3JSNnL6/X3Kzh935AQ/gJNEYXEfJDQFu/sdFuktS9OW2JcH/SJec8TGfRdrpHshH7A==",
"dev": true,
"requires": {
"lodash": "4.17.4"
}
},
"webpack-sources": { "webpack-sources": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.0.1.tgz", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.0.1.tgz",
+5 -3
View File
@@ -2,10 +2,11 @@
"name": "vue2-datepicker", "name": "vue2-datepicker",
"description": "A Datepicker Component For Vue2", "description": "A Datepicker Component For Vue2",
"main": "dist/build.js", "main": "dist/build.js",
"version": "1.8.1", "version": "1.8.2",
"scripts": { "scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot", "dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules" "demo": "cross-env NODE_ENV=production webpack --progress --hide-modules --config webpack.demo.config.js",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules --config webpack.build.config.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@@ -49,6 +50,7 @@
"vue-loader": "^13.0.5", "vue-loader": "^13.0.5",
"vue-template-compiler": "^2.2.1", "vue-template-compiler": "^2.2.1",
"webpack": "^2.2.0", "webpack": "^2.2.0",
"webpack-dev-server": "^2.2.0" "webpack-dev-server": "^2.2.0",
"webpack-merge": "^4.1.1"
} }
} }
+34
View File
@@ -0,0 +1,34 @@
const path = require('path')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.config.js')
const webpack = require('webpack')
const webpackConfig = merge(baseWebpackConfig, {
entry: './index.js',
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/',
filename: 'build.js',
library: "DatePicker",
libraryTarget: "umd"
},
devtool: 'source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
compress: {
warnings: false
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true
})
]
})
module.exports = webpackConfig
+3 -32
View File
@@ -4,11 +4,9 @@ var webpack = require('webpack')
module.exports = { module.exports = {
entry: './demo/main.js', entry: './demo/main.js',
output: { output: {
path: path.resolve(__dirname, './dist'), path: path.resolve(__dirname, './demo'),
publicPath: '/dist/', publicPath: '/demo/',
filename: 'build.js', filename: 'build.js'
library: "DatePicker",
libraryTarget: "umd"
}, },
module: { module: {
rules: [ rules: [
@@ -35,11 +33,6 @@ module.exports = {
} }
] ]
}, },
resolve: {
alias: {
// 'vue$': 'vue/dist/vue.esm.js'
}
},
devServer: { devServer: {
historyApiFallback: true, historyApiFallback: true,
noInfo: true, noInfo: true,
@@ -50,25 +43,3 @@ module.exports = {
}, },
devtool: '#eval-source-map' devtool: '#eval-source-map'
} }
if (process.env.NODE_ENV === 'production') {
module.exports.entry = './index.js'
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: false,
compress: {
warnings: false
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true
})
])
}
+25
View File
@@ -0,0 +1,25 @@
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.config.js')
const webpack = require('webpack')
const webpackConfig = merge(baseWebpackConfig, {
devtool: 'source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
compress: {
warnings: false
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true
})
]
})
module.exports = webpackConfig