chore: remove webpack configs

This commit is contained in:
07akioni 2020-11-03 15:17:33 +08:00
parent f3aa35e5ff
commit 65ca9675b8
7 changed files with 0 additions and 321 deletions

View File

@ -1,73 +0,0 @@
const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const { DefinePlugin } = require('webpack')
exports.alias = {
'naive-ui/lib/icons': path.resolve(__dirname, '../src/_icons'),
'naive-ui': path.resolve(__dirname, '../src/index.js'),
src: path.resolve(__dirname, '../src')
}
exports.resolve = {
extensions: ['.js', '.vue', '.json', '.entry', '.demo-entry.md', '.demo.md', '.md'],
alias: exports.alias,
modules: ['node_modules']
}
exports.docLoaders = (env) => [
{
test: /index\.entry$/,
loader: ['vue-loader', path.resolve(__dirname, '../demo/loaders/NaiveUIDocEntryLoader.js')]
},
{
test: /\.demo\.md$/,
loader: ['vue-loader', path.resolve(__dirname, '../demo/loaders/NaiveUIDemoLoader.js')]
},
{
test: /\.demo-entry\.md$/,
loader: ['vue-loader', path.resolve(__dirname, '../demo/loaders/NaiveUIDocLoader.js')]
},
// TODO: update loader test
{
test: {
test: /\.md$/,
exclude: [/\.demo-entry\.md$/, /\.demo\.md$/]
},
loader: ['vue-loader', path.resolve(__dirname, '../demo/loaders/NaiveUIMdLoader.js')]
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
compilerOptions: {
whitespace: 'condense'
}
}
},
{
test: /\.(js|jsx)$/,
exclude: [/node_modules/],
loader: 'babel-loader',
options: {
plugins: ['@babel/plugin-syntax-dynamic-import']
}
},
{
test: /\.(scss|css)$/,
use: [...(env === 'production' ? [MiniCssExtractPlugin.loader] : []), ...(env === 'production' ? [] : ['style-loader']), 'css-loader', 'postcss-loader', 'sass-loader']
},
{
test: /\.(svg|otf|ttf|woff2?|eot|gif|png|jpe?g)(\?\S*)?$/,
loader: 'url-loader',
query: {
limit: 10000,
name: path.posix.join('static', '[name].[hash:7].[ext]')
}
}
]
exports.plugins = [
new DefinePlugin({
__DEV__: JSON.stringify(process.env.NODE_ENV === 'development')
})
]

View File

@ -1,59 +0,0 @@
/**
* Webpack config to see if css file works on demo page
*/
const path = require('path')
const webpack = require('webpack')
const config = require('./config')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const webpackConfig = {
mode: 'production',
entry: './demo/deployment-index.js',
output: {
path: path.resolve(process.cwd()),
publicPath: '/',
filename: '[name].[hash:7].js',
chunkFilename: '[name].[hash:7].js'
},
resolve: config.resolve,
devServer: {
host: '0.0.0.0',
port: 8087,
publicPath: '/',
hot: false,
historyApiFallback: true
},
performance: {
hints: false
},
stats: {
children: false
},
module: {
rules: config.docLoaders('production')
},
plugins: [
new HtmlWebpackPlugin({
template: './demo/index.tpl',
favicon: './demo/assets/images/naivelogo.svg'
}),
new VueLoaderPlugin(),
new webpack.LoaderOptionsPlugin({
vue: {
compilerOptions: {
preserveWhitespace: false
}
}
}),
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[id].css',
ignoreOrder: false
}),
...config.plugins
]
}
module.exports = webpackConfig

View File

@ -1,56 +0,0 @@
/**
* Webpack config under development
*/
const path = require('path')
const webpack = require('webpack')
const config = require('./config')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { VueLoaderPlugin } = require('vue-loader')
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin')
const webpackConfig = {
mode: 'development',
entry: './demo/index.dev',
output: {
path: path.resolve(process.cwd()),
publicPath: '/',
filename: '[name].[hash:7].js',
chunkFilename: '[name].[hash:7].js'
},
resolve: config.resolve,
devServer: {
host: '0.0.0.0',
port: 14138,
publicPath: '/',
hot: true,
historyApiFallback: true
},
performance: {
hints: false
},
stats: {
children: false
},
module: {
rules: config.docLoaders()
},
plugins: [
new CaseSensitivePathsPlugin(),
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: './demo/index.tpl',
favicon: './demo/assets/images/naivelogo.svg'
}),
new VueLoaderPlugin(),
new webpack.LoaderOptionsPlugin({
vue: {
compilerOptions: {
preserveWhitespace: false
}
}
}),
...config.plugins
]
}
module.exports = webpackConfig

View File

@ -1,52 +0,0 @@
/**
* Webpack config to pack documentation page
*/
const path = require('path')
const webpack = require('webpack')
const config = require('./config')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const webpackConfig = {
mode: 'production',
entry: './demo/deployment-index.js',
output: {
path: path.resolve(__dirname, '..', 'build-doc', 'dist'),
publicPath: '/',
filename: '[name].[hash:7].js',
chunkFilename: '[name].[hash:7].js'
},
resolve: config.resolve,
performance: {
hints: false
},
stats: {
children: false
},
module: {
rules: config.docLoaders('production')
},
plugins: [
new HtmlWebpackPlugin({
template: './demo/index.tpl',
favicon: './demo/assets/images/naivelogo.svg'
}),
new VueLoaderPlugin(),
new webpack.LoaderOptionsPlugin({
vue: {
compilerOptions: {
preserveWhitespace: false
}
}
}),
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[id].css',
ignoreOrder: false
}),
...config.plugins
]
}
module.exports = webpackConfig

View File

@ -1,71 +0,0 @@
/**
* Webpack config for unit test
*/
const path = require('path')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const config = require('./config')
const env = process.env.NODE_ENV
const webpackConfig = {
mode: env === 'production' ? 'production' : 'development',
entry: {
app: ['./src/index.js']
},
output: {
path: path.resolve(process.cwd(), './dist'),
publicPath: '/dist/',
filename: '[name].js',
chunkFilename: '[id].js'
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: config.alias,
modules: ['node_modules']
},
module: {
rules: [
{
test: /\.(jsx?|babel|es6)$/,
include: process.cwd(),
exclude: /node_modules|utils\/popper\.js|utils\/date\.js/,
loader: 'babel-loader'
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
compilerOptions: {
preserveWhitespace: false
}
}
},
{
test: /\.(scss|css)$/,
use: [
'style-loader',
'css-loader',
'sass-loader'
]
},
{
test: /\.(svg|otf|ttf|woff2?|eot|gif|png|jpe?g)(\?\S*)?$/,
loader: 'url-loader',
query: {
limit: 10000,
name: path.posix.join('static', '[name].[hash:7].[ext]')
}
}
]
},
plugins: [
new VueLoaderPlugin()
]
}
// if (!process.env.CI_ENV) {
// webpackConfig.plugins.push(
// new ProgressBarPlugin()
// );
// }
module.exports = webpackConfig

View File

@ -1,5 +0,0 @@
module.exports = Object.assign(
{},
require('./webpack.dev'),
{ entry: './demo/tusimple-index.dev.js' }
)

View File

@ -1,5 +0,0 @@
module.exports = Object.assign(
{},
require('./webpack.doc'),
{ entry: './demo/tusimple-deployment-index.js' }
)