roblouie / ionic2-environment-variables Goto Github PK
View Code? Open in Web Editor NEWDemonstration on how to easily setup environment variables in Ionic 2
Demonstration on how to easily setup environment variables in Ionic 2
I have tried the example in your docs but it just throws an error so I tried setting NODE_ENV to qa explicitly but its the dev thats still called every time.
@roblouie Any reason this won't work vs the actual serve process? We use the www file in production and this won't allow us to build to that.
npm run-script build --prod
[15:05:34] ionic-app-script task: "build"
[15:05:34] Error: ./environment-variables/environment-variables.module.ts Module build failed: TypeError: Cannot read
property 'content' of undefined at Object.optimizationLoader
(/Users/gap4/Documents/WEB/HAWORTH/HIES/hies_client_example/node_modules/@ionic/app-scripts/dist/webpack/optimization-loader-impl.js:14:24)
at Object.loader
(/Users/gap4/Documents/WEB/HAWORTH/HIES/hies_client_example/node_modules/@ionic/app-scripts/dist/webpack/optimization-loader.js:5:32)
@ ./src/app/app.module.ngfactory.js 19:0-84 @
./src/app/main.ts,./environment-variables/environment-variables.token.ts Module build failed: TypeError:
Cannot read property 'content' of undefined at Object.optimizationLoader
(/Users/gap4/Documents/WEB/HAWORTH/HIES/hies_client_example/node_modules/@ionic/app-scripts/dist/webpack/optimization-loader-impl.js:14:24)
at Object.loader
(/Users/gap4/Documents/WEB/HAWORTH/HIES/hies_client_example/node_modules/@ionic/app-scripts/dist/webpack/optimization-loader.js:5:32)
@ ./src/app/app.module.ngfactory.js 113:0-84 @ ./src/app/main.ts
Error: ./environment-variables/environment-variables.module.ts
Module build failed: TypeError: Cannot read property 'content' of undefined
at Object.optimizationLoader (/Users/gap4/Documents/WEB/HAWORTH/HIES/hies_client_example/node_modules/@ionic/app-scripts/dist/webpack/optimization-loader-impl.js:14:24)
at Object.loader (/Users/gap4/Documents/WEB/HAWORTH/HIES/hies_client_example/node_modules/@ionic/app-scripts/dist/webpack/optimization-loader.js:5:32)
@ ./src/app/app.module.ngfactory.js 19:0-84
@ ./src/app/main.ts,./environment-variables/environment-variables.token.ts
Module build failed: TypeError: Cannot read property 'content' of undefined
at Object.optimizationLoader (/Users/gap4/Documents/WEB/HAWORTH/HIES/hies_client_example/node_modules/@ionic/app-scripts/dist/webpack/optimization-loader-impl.js:14:24)
at Object.loader (/Users/gap4/Documents/WEB/HAWORTH/HIES/hies_client_example/node_modules/@ionic/app-scripts/dist/webpack/optimization-loader.js:5:32)
@ ./src/app/app.module.ngfactory.js 113:0-84
@ ./src/app/main.ts
at BuildError.Error (native)
at new BuildError (/Users/gap4/Documents/WEB/HAWORTH/HIES/hies_client_example/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
at /Users/gap4/Documents/WEB/HAWORTH/HIES/hies_client_example/node_modules/@ionic/app-scripts/dist/preprocess.js:18:21
at process._tickCallback (internal/process/next_tick.js:109:7)
getting dev environment after running ionic serve --prod.
C:\env\ionic2-environment-variables>ionic serve --prod
[INFO] Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 - Ctrl+C to cancel
[12:00:05] watch started ...
[12:00:05] build dev started ...
[12:00:05] clean started ...
[12:00:05] clean finished in less than 1 ms
[12:00:05] copy started ...
[12:00:05] transpile started ...
[12:00:09] transpile finished in 3.87 s
[12:00:09] preprocess started ...
[12:00:09] preprocess finished in less than 1 ms
[12:00:09] webpack started ...
[12:00:09] copy finished in 4.18 s
[12:00:16] webpack finished in 7.23 s
[12:00:16] sass started ...
[12:00:19] sass finished in 3.22 s
[12:00:19] postprocess started ...
[12:00:19] postprocess finished in less than 1 ms
[12:00:19] lint started ...
[12:00:19] build dev finished in 14.39 s
[12:00:20] watch ready in 15.41 s
[12:00:21] dev server running: http://localhost:8100/
[INFO] Development server running
Local: http://localhost:8100
External: http://192.168.1.3:8100
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.