-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit 30c1b78
Showing
67 changed files
with
18,221 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
> 1% | ||
last 2 versions | ||
not dead |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
node: true | ||
}, | ||
extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"], | ||
parserOptions: { | ||
parser: "babel-eslint" | ||
}, | ||
rules: { | ||
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off", | ||
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off" | ||
} | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.DS_Store | ||
node_modules | ||
/dist | ||
|
||
# local env files | ||
.env.local | ||
.env.*.local | ||
|
||
# Log files | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
.vscode | ||
.git | ||
build | ||
docs |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# mo-chart | ||
|
||
## 目录说明 | ||
|
||
### components | ||
组件js,html源码文件夹 | ||
|
||
### scss | ||
组件样式源码文件夹 | ||
|
||
### router | ||
页面展示路由配置文件夹 | ||
|
||
### views | ||
组件样例展示文件夹,建议在开发组件的过程中,测试demo写在该文件夹下对应的文件中,后期开发使用文档时可以直接复用,节省编写使用demo的时间,保证使用文档场景的覆盖 |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: ["@vue/cli-plugin-babel/preset"] | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
// text: "./src/components/Text/index.js", | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
// text: "./src/scss/text.scss", | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
const path = require("path"); | ||
const root = path.resolve(__dirname, ".."); // 项目的根目录绝对路径 | ||
const { VueLoaderPlugin } = require("vue-loader"); | ||
const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); | ||
const config = require("./components.js"); | ||
|
||
module.exports = { | ||
entry: config, // 入口文件路径 | ||
output: { | ||
path: path.join(root, "dist/lib"), // 出口目录 | ||
chunkFilename: "[name].js?[chunkhash:5]", | ||
filename: "[name].js", | ||
//library: 'reasyUIVue', | ||
libraryTarget: "commonjs2", | ||
libraryExport: "default" | ||
}, | ||
resolve: { | ||
alias: { | ||
// 配置目录别名 | ||
// 在任意目录下require('components/example') 相当于require('项目根目录/src/components/example') | ||
vue: "vue/dist/vue.js", //解决 [Vue warn]: You are using the runtime-only build of Vue | ||
"@": path.resolve("src") | ||
}, | ||
extensions: [".js", ".vue"] // 引用js和vue文件可以省略后缀名 | ||
}, | ||
|
||
module: { | ||
// 配置loader | ||
rules: [ | ||
{ | ||
test: /\.js$/, //匹配所有.js文件 | ||
use: [ | ||
{ | ||
loader: "babel-loader" | ||
} | ||
], | ||
exclude: /node_modules/ //排除node_module下的所有文件 | ||
}, | ||
{ | ||
test: /\.vue$/, //匹配所有.js文件 | ||
loader: "vue-loader", | ||
options: { | ||
loaders: { | ||
js: "babel-loader", | ||
//css: 'style-loader', | ||
scss: "vue-style-loader!css-loader!sass-loader?indentedSyntax" | ||
}, | ||
extractCSS: true | ||
} | ||
} | ||
] | ||
}, | ||
optimization: { | ||
//webpack 4 | ||
minimize: false | ||
}, | ||
devtool: false, | ||
plugins: [new VueLoaderPlugin(), new UglifyJsPlugin()] | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,119 @@ | ||
const path = require("path"); | ||
const root = path.resolve(__dirname, ".."); // 项目的根目录绝对路径 | ||
const { VueLoaderPlugin } = require("vue-loader"); | ||
const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); | ||
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | ||
|
||
module.exports = { | ||
entry: { | ||
app: ["./src/components/index.js"] | ||
}, // 入口文件路径 | ||
output: { | ||
path: path.join(root, "dist/"), // 出口目录 | ||
publicPath: process.env.NODE_ENV === "publish" ? "/dist" : "/", | ||
chunkFilename: "[name].js?[chunkhash:5]", | ||
filename: "mo-chart.js", | ||
libraryTarget: "commonjs2", | ||
libraryExport: "default", | ||
library: "mo-chart" | ||
}, | ||
resolve: { | ||
alias: { | ||
// 配置目录别名 | ||
// 在任意目录下require('components/example') 相当于require('项目根目录/src/components/example') | ||
vue: "vue/dist/vue.js", //解决 [Vue warn]: You are using the runtime-only build of Vue | ||
"@": path.resolve("src") | ||
}, | ||
extensions: [".js", ".vue"] // 引用js和vue文件可以省略后缀名 | ||
}, | ||
|
||
module: { | ||
// 配置loader | ||
rules: [ | ||
{ | ||
//npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/ | ||
test: /\.(scss|css)$/, | ||
use: [ | ||
//"vue-style-loader", | ||
MiniCssExtractPlugin.loader, | ||
"css-loader", | ||
/* { | ||
loader: 'css-loader', | ||
options: { | ||
modules: true, | ||
importLoaders: 1 | ||
} | ||
}, */ | ||
"postcss-loader", | ||
{ | ||
loader: "sass-loader" | ||
}, | ||
{ | ||
loader: "sass-resources-loader", | ||
options: { | ||
// Provide path to the file with resources | ||
resources: "./src/scss/vars.scss" | ||
} | ||
} | ||
], | ||
exclude: /node_modules/ | ||
}, | ||
|
||
{ | ||
test: /\.(png|jpe?g|gif)(\?.*)?$/, | ||
loader: "url-loader", | ||
options: { | ||
limit: 1000, | ||
publicPath: "/img/", | ||
outputPath: "/img/", | ||
name: "[name].[ext]?[hash:7]" | ||
} | ||
}, | ||
{ | ||
test: /\.(woff|woff2|eot|ttf|svg)$/, | ||
loader: "url-loader", | ||
options: { | ||
publicPath: "/fonts/", | ||
outputPath: "/fonts/", | ||
name: "vui-[name].[ext]?[hash:7]" | ||
} | ||
}, | ||
|
||
{ | ||
test: /\.js$/, //匹配所有.js文件 | ||
use: [ | ||
{ | ||
loader: "babel-loader" | ||
} | ||
], | ||
exclude: /node_modules/ //排除node_module下的所有文件 | ||
}, | ||
{ | ||
test: /\.vue$/, //匹配所有.js文件 | ||
|
||
loader: "vue-loader", | ||
options: { | ||
loaders: { | ||
js: "babel-loader", | ||
//css: 'style-loader', | ||
scss: "vue-style-loader!css-loader!sass-loader?indentedSyntax" | ||
}, | ||
extractCSS: true | ||
} | ||
} | ||
] | ||
}, | ||
optimization: { | ||
//webpack 4 | ||
minimize: false | ||
}, | ||
devtool: false, | ||
plugins: [ | ||
new MiniCssExtractPlugin({ | ||
filename: "styles.css?[contenthash:5]", | ||
chunkFilename: "[id].css" | ||
}), | ||
new VueLoaderPlugin(), | ||
new UglifyJsPlugin() | ||
] | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
const path = require("path"); | ||
const root = path.resolve(__dirname, ".."); // 项目的根目录绝对路径 | ||
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | ||
const { CleanWebpackPlugin } = require("clean-webpack-plugin"); | ||
const config = require("./scss.js"); | ||
module.exports = { | ||
entry: config, // 入口文件路径 | ||
output: { | ||
path: path.join(root, "dist/lib"), // 出口目录 | ||
publicPath: "/" | ||
}, | ||
resolve: { | ||
alias: { | ||
// 配置目录别名 | ||
// 在任意目录下require('components/example') 相当于require('项目根目录/src/components/example') | ||
vue: "vue/dist/vue.js", //解决 [Vue warn]: You are using the runtime-only build of Vue | ||
"@": path.resolve("src") | ||
}, | ||
extensions: [".js", ".vue"] // 引用js和vue文件可以省略后缀名 | ||
}, | ||
|
||
module: { | ||
// 配置loader | ||
rules: [ | ||
{ | ||
//npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/ | ||
test: /\.(scss|css)$/, | ||
use: [ | ||
//"vue-style-loader", | ||
MiniCssExtractPlugin.loader, | ||
"css-loader", | ||
"postcss-loader", | ||
{ | ||
loader: "sass-loader" | ||
}, | ||
|
||
{ | ||
loader: "sass-resources-loader", | ||
options: { | ||
// Provide path to the file with resources | ||
resources: "./src/scss/vars.scss" | ||
} | ||
} | ||
], | ||
exclude: /node_modules/ | ||
}, | ||
{ | ||
test: /\.(woff|woff2|eot|ttf|svg)$/, | ||
loader: "url-loader", | ||
options: { | ||
publicPath: "../../fonts/", | ||
outputPath: "../fonts/", | ||
name: "v-[name].[ext]?[hash:7]" | ||
} | ||
} | ||
] | ||
}, | ||
optimization: { | ||
//webpack 4 | ||
minimize: false | ||
}, | ||
devtool: false, | ||
plugins: [ | ||
new CleanWebpackPlugin(), | ||
new MiniCssExtractPlugin({ | ||
filename: "css/[name].css", | ||
chunkFilename: "[id].css" | ||
}) | ||
] | ||
}; |
Oops, something went wrong.