These are chat archives for opal/opal

11th
Jun 2017
James Carlson
@jxxcarlson
Jun 11 2017 19:48

An trying to use Opal in chrome. Am using Elm via webpack and have this code:

<script>
      var Opal = require("opal-webpack")
      var content = document.getElementById('rendered_text1').innerHTML
      // Have to define Opal somehow
      document.getElementById('rendered_text2').innerHTML = Opal.Asciidoctor.$convert(content)
    </script>

but require gives me an error and my other tries have failed also. I've installed opal via npm and also via npm install opal-webpack --save-dev, then configuring like this:

{
        test:    /\.html$/,
        exclude: /node_modules/,
        loaders:  [
          loader:'file-loader?name=[name].[ext]',
          test: /\.rb?$/,
          loader: 'opalrb-loader'
        ]
      },