Socket
Socket
Sign inDemoInstall

solc-loader

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solc-loader

solc loader module for webpack (WIP)


Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
Source

solc loader for webpack

Compiles .sol with JavaScript Solidity compiler and returns JavaScript objects with Application Binary Interface (ABI) and bytecode ready to be deployed on to Ethereum.

Ideally to be used with web3-loader for automatic deployment and ready-to-use JavaScript instances of smart contracts.

Installation

npm install solc-loader --save-dev

Usage

var SmartContracts = require('solc!./SmartContracts.sol');
// => returns SmartContracts array with each contract name, bytecode and abi.

Example webpack config

At your project's webpack.config.js:

module.exports = {
  module: {
    loaders: [
      {
        test: /\.sol$/,
        loaders: ['solc']
    ]
  }
}

solc-loader would be much sweeter if used along web3-loader. web3-loader automatically deploys new/changed contracts on to Ethereum and returns ready-to-use JavaScript instances of smart contracts.

At your project's webpack.config.js:

module.exports = {
  module: {
    loaders: [
      {
        test: /\.sol$/,
        loaders: ['web3', 'solc']
    ]
  }
}

Extra configuration

Optimization

solc-loader is set to compile with optimization turned on.

To turn off optimization, pass optimize=0 via either query or loader config with the key solcLoader.

Query style
loaders: ['solc?optimize=0']

// or

loader: 'solc?optimize=0'
Config style
module.exports = {
  solcLoader: {
    optimize: 0
  }
}

License

MIT · U-Zyn Chua (@uzyn)

FAQs

Package last updated on 29 Apr 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