dojo / cli-build-webpack

🚀 **DEPRECATED** Dojo 2 - cli command for building applications
http://dojo.io
Other
4 stars 19 forks source link

Unable to load modules where filename ends in 'css' #193

Closed nicknisi closed 7 years ago

nicknisi commented 7 years ago

Bug

The loader is unable to load a module where the filename ends in css. Examples modules include css.ts and postcss.ts (import postcss from './postcss';).

I believe this may be caused by this line because the regex does not look correct, but I haven't yet tested it.

// line 50 - regex should be /\.css$/ maybe?
if (/.css$/.test(importPath)) {

Package Version: 2.0.0-beta2.4

Code

import postcss from './postcss';

Expected behavior:

The module should load with no issues.

Actual behavior:

An error occurs (uncaught promise):

(node:68060) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: ENOENT: no such file or directory, stat '/Users/nicknisi/code/dojo/editor/src/support/postcss'
nicknisi commented 7 years ago

Testing in my project, it looks like fixing that regular expression does fix this issue. I can look into creating a PR.

kitsonk commented 7 years ago

It seems logical that it would. Good catch!