Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack Loader - MVP #50

Closed
1 task done
ballercat opened this issue Dec 27, 2017 · 1 comment
Closed
1 task done

Webpack Loader - MVP #50

ballercat opened this issue Dec 27, 2017 · 1 comment
Assignees

Comments

@ballercat
Copy link
Owner

ballercat commented Dec 27, 2017

Goal

Allow engineers to import .walt modules into their JavaScript.

Overview

Currently, it's possible to import a .walt file into your webpack project via raw-loader followed by manually compiling the source into a WebAssembly module.

Here is an example, from docs:

import code from "./walt/memory";

And here is the very basic webpack config:

const path = require("path");

module.exports = {
  context: __dirname + "/src",

  devtool: "source-map",

  entry: {
    javascript: "./index.js"
  },

  output: {
    filename: "dist/explorer.js"
  },

  resolve: {
    extensions: [".js", ".jsx", ".json", ".scss", ".css", ".walt"]
  },

  module: {
    loaders: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loaders: ["babel-loader"]
      },
      {
        test: /\.html$/,
        loader: "file-loader?name=[name].[ext]"
      },
      {
        test: /\.walt$/,
        loader: "raw-loader"
      },
      {
        test: /\.scss$/,
        loaders: ["style-loader", "css-loader", "sass-loader"]
      },
      {
        test: /\.css$/,
        loaders: ["style-loader", "css-loader"]
      },
      {
        test: /\.(png|woff|woff2|eot|ttf|svg)$/,
        loader: "url-loader",
        query: { mimetype: "image/png" }
      }
    ]
  }
};

Instead, there should be a loader which can read, compile and load .walt files a walt-loader.

Acceptance Criteria

@ballercat ballercat self-assigned this Dec 27, 2017
@ballercat
Copy link
Owner Author

Resolved in #54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant