FredKSchott / create-snowpack-app

The all-in-one app template for Snowpack. [moved]

Home Page:https://www.snowpack.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Webpack plugin should support importing JSON

FredKSchott opened this issue · comments

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

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?

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