Skip to content

Commit

Permalink
chore: add type module in taro demo (#3002)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu authored Mar 29, 2024
1 parent 5ad673a commit 35984c0
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 27 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
env: {
NODE_ENV: '"development"'
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
const path = require('path')
import path from 'path'
import dev from './dev'
import prod from './prod'

const config = {
projectName: '@nutui/nutui-taro-demo',
date: '2021-5-29',
Expand All @@ -10,7 +13,7 @@ const config = {
375: 2 / 1
},
sourceRoot: 'src',
outputRoot: 'dist',
outputRoot: `dist/${process.env.TARO_ENV === 'h5' ? 'h5' : process.env.TARO_ENV}`,
plugins: [
'@tarojs/plugin-html',
[
Expand Down Expand Up @@ -99,9 +102,9 @@ const config = {
}
}

module.exports = function (merge) {
export default function (merge) {
if (process.env.NODE_ENV === 'development') {
return merge({}, config, require('./dev'))
return merge({}, config, dev)
}
return merge({}, config, require('./prod'))
return merge({}, config, prod)
}
18 changes: 0 additions & 18 deletions packages/nutui-taro-demo/config/prod.js

This file was deleted.

10 changes: 10 additions & 0 deletions packages/nutui-taro-demo/config/prod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default {
env: {
NODE_ENV: '"production"'
},
defineConstants: {},
mini: {},
h5: {
publicPath: '/taro/vue/4x/demo/'
}
}
1 change: 1 addition & 0 deletions packages/nutui-taro-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@nutui/nutui-taro-demo",
"version": "1.0.0",
"private": true,
"type": "module",
"description": "nutui-taro-demo",
"templateInfo": {
"name": "default",
Expand Down
4 changes: 2 additions & 2 deletions packages/nutui-taro-demo/project.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"miniprogramRoot": "dist/",
"projectname": "%40nutui%2Fnutui-taro-demo",
"miniprogramRoot": "dist/weapp",
"projectname": "@nutui/nutui-taro-demo",
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"appid": "wxf2b976b67dab3882",
"setting": {
Expand Down
1 change: 0 additions & 1 deletion packages/nutui-taro-demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"target": "es2017",
"module": "commonjs",
"removeComments": false,
"preserveConstEnums": true,
"moduleResolution": "node",
Expand Down

0 comments on commit 35984c0

Please sign in to comment.