FredKSchott / create-snowpack-app

The all-in-one app template for Snowpack. [moved]
https://www.snowpack.dev
Other
727 stars 96 forks source link

Webpack plugin should support importing JSON #125

Closed FredKSchott closed 4 years ago

FredKSchott commented 4 years ago

See this issue: currently it doesn't seem to: https://www.pika.dev/npm/snowpack/discuss/355

danprince commented 4 years ago

Just run into this too whilst testing the webpack plugin for #131.

The issue here seems to be that the JSON file isn't really a JSON file at the point when Webpack processes it. Is the fix to just handle .json with babel-loader instead?

        module: {
          rules: [
            {
-             test: /\.js$/,
+             test: /\.(js|json)$/,
              use: [
                {
                  loader: "babel-loader",

Or should we be pointing webpack back to the original json file on disk?

FredKSchott commented 4 years ago

Looks like it was our catch-all for the file-loader that was causing trouble. Fixed in #132