mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-30 12:52:43 +08:00
build: rename some files
This commit is contained in:
parent
e2174712bb
commit
96f3d41824
31
build/naiveSCSSVarPlugin.js
Normal file
31
build/naiveSCSSVarPlugin.js
Normal file
@ -0,0 +1,31 @@
|
||||
const sass = require('node-sass')
|
||||
const path = require('path')
|
||||
|
||||
function createStyleScheme (css) {
|
||||
return css
|
||||
.replace(':export', 'export default')
|
||||
.replace(/:\s/g, `: '`)
|
||||
.replace(/;/g, `',`)
|
||||
}
|
||||
|
||||
module.exports = function naiveSCSSExportVariable () {
|
||||
return {
|
||||
name: 'naive-scss-export-variable',
|
||||
resolveId (source, importer) {
|
||||
if (source.endsWith('.scss')) {
|
||||
return path.resolve(path.dirname(importer), source)
|
||||
}
|
||||
return null
|
||||
},
|
||||
load (id) {
|
||||
if (id.endsWith('.scss')) {
|
||||
const css = sass.renderSync({
|
||||
file: id,
|
||||
outputStyle: 'expanded'
|
||||
}).css.toString()
|
||||
const styleScheme = createStyleScheme(css)
|
||||
return styleScheme
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -9,7 +9,7 @@ const VueLoaderPlugin = require('vue-loader/lib/plugin')
|
||||
|
||||
const webpackConfig = {
|
||||
mode: 'development',
|
||||
entry: './demo/indexUsingCss.js',
|
||||
entry: './demo/deploymentIndex.js',
|
||||
output: {
|
||||
path: path.resolve(process.cwd()),
|
||||
publicPath: '/',
|
||||
|
@ -9,7 +9,7 @@ const VueLoaderPlugin = require('vue-loader/lib/plugin')
|
||||
|
||||
const webpackConfig = {
|
||||
mode: 'development',
|
||||
entry: './demo/index.js',
|
||||
entry: './demo/devIndex',
|
||||
output: {
|
||||
path: path.resolve(process.cwd()),
|
||||
publicPath: '/',
|
||||
|
@ -10,7 +10,7 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
|
||||
const webpackConfig = {
|
||||
mode: 'production',
|
||||
entry: './demo/indexUsingCss.js',
|
||||
entry: './demo/deploymentIndex.js',
|
||||
output: {
|
||||
path: path.resolve(__dirname, '..', 'doc', 'dist'),
|
||||
publicPath: '/',
|
||||
|
@ -8,7 +8,7 @@
|
||||
<template v-slot:activator>
|
||||
<n-button>退出游戏</n-button>
|
||||
</template>
|
||||
我看 B 站的时候,听说有些冲钱也是找罪受。
|
||||
我看 B 站的时候,听说有些游戏冲钱也是找罪受。
|
||||
</n-popconfirm>
|
||||
```
|
||||
```js
|
||||
|
@ -2,7 +2,7 @@ const vue = require('rollup-plugin-vue')
|
||||
const resolve = require('@rollup/plugin-node-resolve')
|
||||
const strip = require('@rollup/plugin-strip')
|
||||
const { terser } = require('rollup-plugin-terser')
|
||||
const naiveSCSSVariable = require('./build/naiveScssVarPlugin')
|
||||
const naiveSCSSVariable = require('./build/naiveSCSSVarPlugin')
|
||||
|
||||
function externalValidator (ids) {
|
||||
return id => ids.some(identifier => id.startsWith(identifier))
|
||||
|
Loading…
Reference in New Issue
Block a user