3
无法导入CSS / SCSS模块。TypeScript说“找不到模块”
我正在尝试从CSS模块导入主题,但是TypeScript给我一个“找不到模块”错误,并且该主题未在运行时应用。我认为Webpack配置有问题,但是我不确定问题出在哪里。 我正在使用以下工具: "typescript": "^2.0.3" "webpack": "2.1.0-beta.25" "webpack-dev-server": "^2.1.0-beta.9" "react": "^15.4.0-rc.4" "react-toolbox": "^1.2.3" "node-sass": "^3.10.1" "style-loader": "^0.13.1" "css-loader": "^0.25.0" "sass-loader": "^4.0.2" "sass-lint": "^1.9.1" "sasslint-webpack-plugin": "^1.0.4" 这是我的 webpack.config.js var path = require('path'); var webpack = require('webpack'); var sassLintPlugin = require('sasslint-webpack-plugin'); module.exports = { entry: [ 'webpack-dev-server/client?http://localhost:8080', 'webpack/hot/dev-server', './src/index.tsx', ], output: { path: …