i have following coffeescript...
logicthing = dosomething: (obj) -> console.log(obj) ... if module? module.exports = logicthing : logicthing
then in file use by
logicthing.dosomething({name: object})
then in webpack make sure gets loaded first...
var files = glob.sync([ './src/main/coffee/utilities/logicthing.coffee', './src/main/coffee/**/*module.coffee', './src/main/coffee/**/*.coffee' ]); module.exports = { context: __dirname, entry: { polyfills: './src/main/typescripts/polyfills.ts', vendor: './src/main/typescripts/vendor.ts', resources: './src/main/typescripts/resources.ts', app: files }, ... }
problem once compile using webpack get...
referenceerror: logicthing not defined
when try add webpack this...
plugins: [ new webpack.provideplugin({ ... logicthing: 'logicthing' }), ... ]
but when call webpack get...
module not found: error: cannot resolve module 'logicthing' in
how handle situation?
fyi
"coffee-script": "^1.10.0",
update
per comments tried adding other file...
require("../logicthing")
to top of file still get...
referenceerror: logicthing not defined
Comments
Post a Comment