Skip to content

icarito/python-webpack-loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Webpack Loader

Loads Python files and transpile to JavaScript using the awesome Transcrypt or Jiphy compilers.

Install

pip install transcrypt
npm install --save-dev py-loader

You may specify jiphy instead of transcrypt if you prefer. In this case, ensure that options.compiler in webpack.config.js is set to jiphy (see below).

Usage

import Something from 'main.py';

Configuration

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.py$/,
        loader: 'py-loader'
        options: {
          compiler: 'transcrypt'
        }
      }
    ]
  }
}

Extend

py-loader can be extended to use other Python compilers. Just fork this repo and extend the compilers object in index.js.

Please submit a pull request with your addition.

About

A webpack loader for the python language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 93.3%
  • HTML 5.4%
  • Python 1.3%