2019-05-24 20:09:35 +08:00
|
|
|
const path = require('path')
|
|
|
|
|
|
|
|
exports.alias = {
|
|
|
|
main: path.resolve(__dirname, '../src'),
|
|
|
|
packages: path.resolve(__dirname, '../packages'),
|
2019-10-24 18:04:31 +08:00
|
|
|
examples: path.resolve(__dirname, '../examples'),
|
2019-10-25 12:48:10 +08:00
|
|
|
'naive-ui/lib': path.resolve(__dirname, '../lib')
|
2019-06-04 11:30:56 +08:00
|
|
|
}
|
2019-10-10 22:38:29 +08:00
|
|
|
|
|
|
|
exports.docLoaders = [
|
|
|
|
{
|
|
|
|
test: /index.entry$/,
|
|
|
|
loader: ['vue-loader', path.resolve(__dirname, '../demo/loaders/NaiveUIDocEntryLoader.js')]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /index\.md$/,
|
|
|
|
loader: ['vue-loader', path.resolve(__dirname, '../demo/loaders/NaiveUIDocLoader.js')]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /(README\.md$|\.vue\.md$)/,
|
|
|
|
loader: ['vue-loader', path.resolve(__dirname, '../demo/loaders/NaiveUIMdLoader.js')]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: {
|
|
|
|
test: /\.md$/,
|
|
|
|
exclude: [/index\.md$/, /README\.md$/, /\.vue\.md$/]
|
|
|
|
},
|
|
|
|
loader: ['vue-loader', path.resolve(__dirname, '../demo/loaders/NaiveUIDemoLoader.js')]
|
|
|
|
},
|
2019-10-23 22:37:46 +08:00
|
|
|
// {
|
|
|
|
// test: /\.demo\.vue$/,
|
|
|
|
// loader: ['vue-loader', path.resolve(__dirname, '../doc/NaiveUIDemoLoader.js')]
|
|
|
|
// },
|
2019-10-10 22:38:29 +08:00
|
|
|
{
|
|
|
|
test: {
|
2019-10-23 22:37:46 +08:00
|
|
|
test: /\.vue$/
|
2019-10-10 22:38:29 +08:00
|
|
|
},
|
|
|
|
loader: 'vue-loader',
|
|
|
|
options: {
|
|
|
|
compilerOptions: {
|
|
|
|
preserveWhitespace: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(js|jsx)$/,
|
|
|
|
exclude: [/node_modules/],
|
2019-10-30 18:59:47 +08:00
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
plugins: ['@babel/plugin-syntax-dynamic-import']
|
|
|
|
}
|
2019-10-10 22:38:29 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
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]')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
resourceQuery: /blockType=i18n/,
|
|
|
|
type: 'javascript/auto',
|
|
|
|
loader: '@kazupon/vue-i18n-loader'
|
|
|
|
}
|
|
|
|
]
|