forked from nuxt-community/python-module
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule.js
More file actions
26 lines (20 loc) · 734 Bytes
/
Copy pathmodule.js
File metadata and controls
26 lines (20 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module.exports = function PythonModule (moduleOptions) {
var options = Object.assign({}, this.options.python, moduleOptions)
if (options.compiler === undefined) {
options.compiler = 'pj'
}
this.nuxt.options.extensions.push('py')
this.extendBuild((config, { isClient, isServer }) => {
config.devtool = '#cheap-module-eval-source-map'
config.resolve.extensions.push('.py')
const vueLoader = config.module.rules.find((rule) => rule.loader === 'vue-loader')
vueLoader.options.loaders.py = { loader: 'py-loader',
options: options }
config.module.rules.push({
test: /\.py$/,
loader: 'py-loader',
options: options
})
})
}
module.exports.meta = require('../package.json')