-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
39,112 additions
and
19,924 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,70 @@ | ||
const path = require('path') | ||
const webpack = require('webpack') | ||
const { VueLoaderPlugin } = require('vue-loader') | ||
const path = require("path"); | ||
const webpack = require("webpack"); | ||
const { VueLoaderPlugin } = require("vue-loader"); | ||
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin | ||
const pkg = require("../package.json"); | ||
const ProgressBarPlugin = require('progress-bar-webpack-plugin'); | ||
const ProgressBarPlugin = require("progress-bar-webpack-plugin"); | ||
const TerserPlugin = require("terser-webpack-plugin"); | ||
|
||
let externals = [ | ||
{ | ||
vue: { | ||
root: 'Vue', | ||
commonjs: 'vue', | ||
commonjs2: 'vue', | ||
}, | ||
}, | ||
] | ||
const entry = [path.resolve(__dirname, "..", "src")]; | ||
const plugins = [ | ||
new VueLoaderPlugin(), | ||
new ProgressBarPlugin(), | ||
// new BundleAnalyzerPlugin(), | ||
new VueLoaderPlugin(), | ||
new webpack.NormalModuleReplacementPlugin( | ||
// eslint-disable-next-line no-useless-escape | ||
/element-plus[/\\]lib[/\\]locale[/\\]lang[/\\]en/, | ||
'zh-cn.js', | ||
), | ||
] | ||
"zh-cn.js" | ||
) | ||
]; | ||
const externals = [ | ||
{ | ||
vue: { | ||
root: "Vue", | ||
commonjs: "vue", | ||
commonjs2: "vue" | ||
} | ||
} | ||
]; | ||
|
||
const entry = path.resolve(__dirname, '../src/index.js') | ||
const output = { | ||
path: path.resolve(__dirname, "../dist"), | ||
publicPath: "/", | ||
filename: "index.min.js", | ||
libraryTarget: "umd", | ||
library: "DateWeekRange", | ||
umdNamedDefine: true, | ||
globalObject: "typeof self !== 'undefined' ? self : this" | ||
}; | ||
|
||
const config = { | ||
mode: 'production', | ||
mode: "production", | ||
entry, | ||
output: { | ||
path: path.resolve(__dirname, '../dist'), | ||
publicPath: '/', | ||
filename: pkg.name + '.min.js', | ||
libraryTarget: 'umd', | ||
library: 'DateWeekRange', | ||
umdNamedDefine: true, | ||
globalObject: 'typeof self !== \'undefined\' ? self : this', | ||
}, | ||
output, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.vue$/, | ||
use: 'vue-loader', | ||
use: "vue-loader" | ||
}, | ||
{ | ||
test: /\.(ts|js)x?$/, | ||
exclude: /node_modules/, | ||
loader: 'babel-loader', | ||
}, | ||
], | ||
loader: "babel-loader" | ||
} | ||
] | ||
}, | ||
resolve: { | ||
extensions: ['.ts', '.tsx', '.js', '.json', '.vue'], | ||
extensions: [".ts", ".tsx", ".js", ".json", ".vue", ".mjs", ".css"] | ||
}, | ||
externals, | ||
plugins, | ||
} | ||
optimization: { | ||
minimize: true, | ||
minimizer: [ | ||
new TerserPlugin({ | ||
extractComments: false | ||
}) | ||
] | ||
} | ||
}; | ||
|
||
module.exports = config | ||
module.exports = config; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
import { createApp } from 'vue' | ||
import App from './App.vue' | ||
import DateWeekRange from '../../src/index' | ||
import elementPlus from 'element-plus' | ||
import 'element-plus/lib/theme-chalk/el-date-picker.css' | ||
import 'element-plus/lib/theme-chalk/el-icon.css' | ||
import 'dayjs/locale/zh-cn' | ||
import locale from 'element-plus/lib/locale/lang/zh-cn' | ||
import DateWeekRange from '../../dist/index.min' | ||
import '../../dist/index.css' | ||
|
||
const app = createApp(App) | ||
|
||
app.use(DateWeekRange) | ||
app.use(elementPlus, { locale }) | ||
app.mount('#app'); | ||
|
||
export default app; |
Oops, something went wrong.