Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-client-taro
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6d03ea4b
authored
Aug 12, 2019
by
lirandong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
349fa2ff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
11 deletions
+33
-11
config/index.js
+27
-5
src/pages/home/tempaltes/index.tsx
+1
-1
tsconfig.json
+5
-5
No files found.
config/index.js
View file @
6d03ea4b
const
path
=
require
(
'path'
)
// NOTE 在 sass 中通过别名(@ 或 ~)引用需要指定路径
const
lessImporter
=
function
(
url
)
{
if
(
url
[
0
]
===
'~'
&&
url
[
1
]
!==
'/'
)
{
return
{
file
:
path
.
resolve
(
__dirname
,
'..'
,
'node_modules'
,
url
.
substr
(
1
))
}
}
const
reg
=
/^@styles
\/(
.*
)
/
return
{
file
:
reg
.
test
(
url
)
?
path
.
resolve
(
__dirname
,
'..'
,
'src/styles'
,
url
.
match
(
reg
)[
1
])
:
url
}
}
const
config
=
{
const
config
=
{
projectName
:
'Vmatrix-client-taro'
,
projectName
:
'Vmatrix-client-taro'
,
date
:
'2019-8-6'
,
date
:
'2019-8-6'
,
...
@@ -11,11 +27,11 @@ const config = {
...
@@ -11,11 +27,11 @@ const config = {
outputRoot
:
'dist'
,
outputRoot
:
'dist'
,
alias
:
{
alias
:
{
'@/'
:
path
.
resolve
(
__dirname
,
'..'
,
'src'
),
'@/'
:
path
.
resolve
(
__dirname
,
'..'
,
'src'
),
'@
api/
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/api'
),
'@
/api
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/api'
),
'@
pages/
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/pages'
),
'@
/pages
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/pages'
),
'@
actions/
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/actions'
),
'@
/actions
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/actions'
),
'@
constants/
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/constants'
),
'@
/constants
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/constants'
),
'@
conpoments/
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/conpoments'
),
'@
/conpoments
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/conpoments'
),
},
},
plugins
:
{
plugins
:
{
babel
:
{
babel
:
{
...
@@ -30,6 +46,9 @@ const config = {
...
@@ -30,6 +46,9 @@ const config = {
'transform-class-properties'
,
'transform-class-properties'
,
'transform-object-rest-spread'
'transform-object-rest-spread'
]
]
},
less
:
{
importer
:
lessImporter
}
}
},
},
defineConstants
:
{
defineConstants
:
{
...
@@ -97,6 +116,9 @@ const config = {
...
@@ -97,6 +116,9 @@ const config = {
generateScopedName
:
'[name]__[local]___[hash:base64:5]'
generateScopedName
:
'[name]__[local]___[hash:base64:5]'
}
}
}
}
},
lessLoaderOption
:
{
importer
:
lessImporter
}
}
}
}
}
}
...
...
src/pages/home/tempaltes/index.tsx
View file @
6d03ea4b
...
@@ -3,7 +3,7 @@ import TempItem from './temp_item/temp_item'
...
@@ -3,7 +3,7 @@ import TempItem from './temp_item/temp_item'
import
Taro
,
{
Component
,
Config
}
from
'@tarojs/taro'
import
Taro
,
{
Component
,
Config
}
from
'@tarojs/taro'
import
{
View
,
Text
,
Input
,
ScrollView
,
Image
}
from
'@tarojs/components'
import
{
View
,
Text
,
Input
,
ScrollView
,
Image
}
from
'@tarojs/components'
import
'./index.less'
import
'./index.less'
import
api
from
'@api/index'
import
api
from
'@
/
api/index'
type
PageStateProps
=
{}
type
PageStateProps
=
{}
...
...
tsconfig.json
View file @
6d03ea4b
...
@@ -22,11 +22,11 @@
...
@@ -22,11 +22,11 @@
"typeRoots"
:
[
"node_modules/@types"
],
"typeRoots"
:
[
"node_modules/@types"
],
"paths"
:
{
"paths"
:
{
"@/*"
:
[
"*"
],
"@/*"
:
[
"*"
],
"@
api/
*"
:
[
"api/*"
],
"@
/api
*"
:
[
"api/*"
],
"@
pages/
*"
:
[
"pages/*"
],
"@
/pages
*"
:
[
"pages/*"
],
"@
actions/
*"
:
[
"actions/*"
],
"@
/actions
*"
:
[
"actions/*"
],
"@
constants/
*"
:
[
"constants/*"
],
"@
/constants
*"
:
[
"constants/*"
],
"@
conpoments/
*"
:
[
"conpoments/*"
]
"@
/conpoments
*"
:
[
"conpoments/*"
]
}
}
},
},
"exclude"
:
[
"node_modules"
,
"dist"
],
"exclude"
:
[
"node_modules"
,
"dist"
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment