0
votes

I want to be able to import related web resource, like utility web resource, from my current web resource in Dynamics CRM. This will allow me to split my code across multiple files rather than including everything into a single web resource file.

Something like:

import * as dateUtil from '../util/dateUtil.js'

I have already tried stacking them in Dynamics itself. But what I really want is for Dynamics itself to pull the related web resource after I specify it as imports.

2

2 Answers

1
votes

I think you can solve this by adding the utility web resource as dependency in current web resource.

enter image description here

With Dynamics 365 for Customer Engagement apps version 9.0 the behavior for JavaScript web resources is enhanced so that any other web resource listed as a dependency to the JavaScript web resource will be loaded along with the JavaScript web resource.

Reference

0
votes

You can either can use webpack to resolve those imports for you at transpile time and form one single javascript file OR you use tools like head.js or require.js. Those are actually used by some Microsoft apps like proejct services.