1
鉴于此行index.jsx:模组分辨率没有扩展
import ExampleTable from 'table';
我越来越:
Module not found: Error: Cannot resolve module 'table' in global-path-to/application/public/scripts @ ./application/public/scripts/index.jsx 19:13-29
但table.jsx住该文件夹中,我已经尝试定义在webpack.config.js文件扩展名:
{
entry:SOURCE_DIRECTORY + '/index.jsx',
output:
{
path:SCRIPT_DIRECTORY,
filename:'bundle.js'
},
resolve:
{
extensions:['', '.js', '.jsx']
},
module:
{
loaders:
[
{
// Regular expression to find both .js and .jsx files.
test:/\.jsx?$/,
include:SCRIPT_DIRECTORY,
loader: 'babel'
}
]
}
};
$ npm ls --depth 0
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
没错。这样可行。我以为我尝试了这种排列组合...... – Kenny