link2192 link2193 link2194 link2195 link2196 link2197 link2198 link2199 link2200 link2201 link2202 link2203 link2204 link2205 link2206 link2207 link2208 link2209 link2210 link2211 link2212 link2213 link2214 link2215 link2216 link2217 link2218 link2219 link2220 link2221 link2222 link2223 link2224 link2225 link2226 link2227 link2228 link2229 link2230 link2231 link2232 link2233 link2234 link2235 link2236 link2237 link2238 link2239 link2240 link2241 link2242 link2243 link2244 link2245 link2246 link2247 link2248 link2249 link2250 link2251 link2252 link2253 link2254 link2255 link2256 link2257 link2258 link2259 link2260 link2261 link2262 link2263 link2264 link2265 link2266 link2267 link2268 link2269 link2270 link2271 link2272 link2273 link2274 link2275 link2276 link2277 link2278 link2279 link2280 link2281 link2282 link2283 link2284 link2285 link2286 link2287 link2288 link2289 link2290 link2291 link2292 link2293 link2294 link2295 link2296 link2297 link2298 link2299 link2300 link2301 link2302 link2303 link2304 link2305 link2306 link2307 link2308 link2309 link2310 link2311 link2312 link2313 link2314 link2315 link2316 link2317 link2318 link2319 link2320 link2321 link2322 link2323 link2324 link2325 link2326 link2327 link2328

[Vue.js] Building Vue for development and runtime only for use in Chrome Apps

when struggling with converting a jQuery based Chrome app to Vue. Because of Chrome Apps’ Content Security Policy (CSP) it is not possible to use eval() and thus compiling templates must be done beforehand.

That itself is not a problem with Vue’s Single File Components (SFC) approach where all templates get compiled to render functions in the build process.

However, since the build target is production all warnings and helpful comments from vue.js are stripped off. So for example, if I forget a property for a component, I get not warning about it. It just won’t show up. That makes development very difficult.

Then, if I in package.json for build use:

“build”: “vue-cli-service build –mode development”

I get an error in the Chrome app:

Uncaught EvalError: Refused to evaluate a string as JavaScript because ‘unsafe-eval’ is not an allowed source of script in the following Content Security Policy directive: “script-src ‘self’ blob: filesystem: chrome-extension-resource: ‘wasm-eval’”.

And there are indeed a lot of evals in the index.js file starting with


So my question is:

How do I make the build system preserve warnings and hints in the console without using the forbidden eval’s?

when not sure if the problem is caused by the template compiler being included, but if so, how do I tell the builder not to use the compiler but still use development mode?

Solution :

It is an “issue” with the CSP, you need to use the vue.runtime.js version of Vue.

Please refer to