Code Monkey home page Code Monkey logo

react-ts-music's Introduction

react-ts-music

react全家桶 + typescript 仿网易云音乐

本地使用项目指南

处理sass预处理器

找到node_modules/react-scripts/ts/config/webpack.config.dev.js文件,在oneOf中添加:

  {
     test: /\.scss$/,
     loaders: ['style-loader', 'css-loader', 'sass-loader']
  }

然后找到exclude,添加/\.scss$/

exclude: [/\.(js|jsx|mjs)$/, /\.html$/, /\.json$/, /\.scss$/]

api使用

找到src/utils/config.ts,修改:

url: {
  baseUrl: process.env.NODE_ENV === 'development' ? 'http://xxx.xxx.x.xxx:3000/' : '/'
}

其中xxx.xxx.x.xxx为你本地ip地址

此外还有另外一个问题就是create-react-app的默认端口为3000,而开源的网易云api库默认端口也为3000(虽然可以通过每次node启动修改端口,但是我懒,愿意修改的详情可看文档),因此可以选择一种一劳永逸的方法,在node_modules/react-scripts-ts/scripts/start.js中找到DEFAULT_PORT修改:

const DEFAULT_PORT = 4000  //端口多少随意

api来源

感谢阿发大佬开源网易云音乐 node.js API service

react-ts-music's People

Contributors

biaodigit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.