Skip to content

Commit

Permalink
build: rename some files
Browse files Browse the repository at this point in the history
  • Loading branch information
07akioni committed Feb 13, 2020
1 parent e217471 commit 96f3d41
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 5 deletions.
31 changes: 31 additions & 0 deletions build/naiveSCSSVarPlugin.js
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}
2 changes: 1 addition & 1 deletion build/webpack.demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '/',
Expand Down
2 changes: 1 addition & 1 deletion build/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '/',
Expand Down
2 changes: 1 addition & 1 deletion build/webpack.doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '/',
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion demo/documentation/components/popconfirm/zhCN/event.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<template v-slot:activator>
<n-button>退出游戏</n-button>
</template>
我看 B 站的时候,听说有些冲钱也是找罪受
我看 B 站的时候,听说有些游戏冲钱也是找罪受
</n-popconfirm>
```
```js
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions think.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ Previously, it would not work with single quotes:
31. BaseLoading 代替 Log 里的 Spin
32. Modal 内部组件的卸载方式
33. Anchor 的另一种模式,追踪内容按照的是中间范围而不是自身大小
34. bug md-loader alert 内的 code 不显示


```
Expand Down

0 comments on commit 96f3d41

Please sign in to comment.