git clone https://github.com/labnol/apps-script-starter test-apps-script
cd test-apps-script
add file testimport.js with below content under src/server folder and import it in src/index.js
import { makeQueryString } from './http';
global.testimport = () => {
const url = makeQueryString('https://google.com');
Logger.log(`Query string is ${url}`);
};
npm install
npm run build
Actual Result
in code.js, the new function definition is not created. The new function is not created in the apps script after deploy
function sendmail() {}
function showHelp() {}
function showCredits() {}
function onOpen() {}
function doGet() {}
...
Expected Result
function sendmail() {}
function showHelp() {}
function showCredits() {}
function onOpen() {}
function doGet() {}
function testimport() {}
...
Turn the webpack mode to none fix the problem.
Functions in file without imports also do not have this problem in both mode.
Is there a fix to support this in production mode?
Steps to reproduce
Run the following commands:
git clone https://github.com/labnol/apps-script-starter test-apps-script cd test-apps-script add file
testimport.js
with below content undersrc/server
folder and import it insrc/index.js
npm install npm run build
Actual Result
in
code.js
, the new function definition is not created. The new function is not created in the apps script after deployExpected Result
Turn the webpack mode to none fix the problem. Functions in file without imports also do not have this problem in both mode. Is there a fix to support this in production mode?