Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

solidity-loader

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solidity-loader

Webpack loader to compile a solidity contract and return output

  • 0.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
increased by450%
Maintainers
1
Weekly downloads
 
Created
Source

Solidity Loader

This solidity loader was orignally designed to be used in conjuntion with the pudding-loader. See this basic setup below.

Basic Setup
module: {
    loaders: [
    {
      test: /\.js$/,
      exclude: /(node_modules)/,
      loaders: ['babel'],
      include: path.join(__dirname, 'src'),
      query: {
        presets: ['es2015'],
        plugins: ['transform-runtime']
      }
    },
    { test: /\.sol$/, loaders: ["pudding-loader","solidity-loader"]},
    { test: /\.css$/, loader: "style-loader!css-loader" },
    { test: /\.png$/, loader: "url-loader?limit=100000" },
    { test: /\.json$/, loader: "json-loader" },
    { test: /\.jpg$/, loader: "file-loader" }]
  }

In order for the pudding-loader and solidity-loader to work together, they need to be in this particlar order in loaders: []. (Possible race condition issue?)

This setup allows you to hot-reload and export callable javascript functions to an RPC endpoint.


Pure Solidity Setup
module: {
    loaders: [
    {
      test: /\.js$/,
      exclude: /(node_modules)/,
      loaders: ['babel'],
      include: path.join(__dirname, 'src'),
      query: {
        presets: ['es2015'],
        plugins: ['transform-runtime']
      }
    },
    { test: /\.sol$/, loaders: ["solidity-loader?export=true"]},
    { test: /\.css$/, loader: "style-loader!css-loader" },
    { test: /\.png$/, loader: "url-loader?limit=100000" },
    { test: /\.json$/, loader: "json-loader" },
    { test: /\.jpg$/, loader: "file-loader" }]
  }

The ?export=true query creates an object with contract factories and contract information.

It's a basic import and doesn't do everything, but sets up the watchers, and allows basic imports.


Questions or Issues? File it! Or better yet, a pull request, with a demo to test with. Thanks and enjoy.

Contributors:

@jeffscottward

@SilentCicero

Keywords

FAQs

Package last updated on 11 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc