1.0.7 • Published 7 years ago

truffle-contract-loader v1.0.7

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

Webpack loader for importing .sol files as Truffle contracts using truffle-compile (and by extension, its solc and Solidity version pragma).

Additionally, this loader will refrain from creating any pre-compiled contract artifact files. Dependency trees are resolved by first merging the files and then feeding the result to the compiler. Compiled contracts are stored in memory and cached.

First install the package:

yarn add truffle-contract-loader

Then insert this into your webpack config:

// webpack 2+
module.exports = {
  // ...
  module: {
    // ...
    rules: [
      // ...
      {
        test: /\.sol$/,
        use: {
          loader: 'truffle-contract-loader',
          options: {
            contracts_directory: './contracts', // required - the directory containing all your Solidity contracts
            solc: { // solc compiler options (optional) - defaults to the following (more information found here: http://solidity.readthedocs.io/en/develop/using-the-compiler.html)
              optimizer: {
                enabled: true,
                runs: 200
              }
            }
          }
        }
      }
      // ...
    ]
    // ...
  }
  // ...
}
1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

888.0.0

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago