如何告诉Webpacker停止加载.spec.ts文件

时间:2018-11-30 16:46:43

标签: ruby-on-rails angular typescript webpack webpacker

我的webpacker配置加载了我们所有的测试文件和用于生产构建的帮助程序。我现在需要排除所有以def execM2StoredProc(params, storedProcName): conn = dbConnection(db=sandra.db) cursor = conn.cursor() for p, v in params.iteritems(): if p in ['padmin_no','pusi_trade_ref_id','pbranch_trade_id','pversion','pdealer_intervention_id','pibt_short_code']: params[p] = cursor.var(cx_Oracle.STRING) elif v[1] is not None: if v[0] is not None: if v[1] =='bit': if v[0].upper() in ['FALSE','TRUE']: params[p] = v[0][0] elif len(v[0])==1: try: params[p] = int(v[0]) except ValueError as e: print e.message finally: params[p] = v[0] else: params[p] = v[0] elif v[1] in ['int', 'number', 'Double']: if isinstance(v[0],list): params[p] = cursor.arrayvar(cx_Oracle.NUMBER, [float(i) for i in v[0]]) else: params[p] = float(v[0]) elif v[1] == 'date': if isinstance(v[0],list): params[p] = cursor.arrayvar(cx_Oracle.TIMESTAMP, [datetime.strptime(i, '%Y%m%d').date() for i in v[0]]) else: params[p] = datetime.strptime(v[0], '%Y%m%d').date() elif v[1] == 'datetime': if isinstance(v[0],list): params[p] = cursor.arrayvar(cx_Oracle.TIMESTAMP, [datetime.strptime(i, '%Y%m%d') for i in v[0]]) else: params[p] = datetime.strptime(v[0], '%Y%m%d %H%M%S') elif v[1] == 'String': if isinstance(v[0],list): params[p] = cursor.arrayvar(cx_Oracle.STRING, [i for i in v[0]]) else: params[p] = v[0] else: params[p]=v[0] else: var = cursor.var(CX_ORACLE_TYPES[v[1]]) cursor.setinputsizes(None, var) params[p] = None else: params[p] = v[0] try: ret = cursor.callproc(storedProcName, [], params) # conn.commit() except Exception as e: print e.message finally: conn.close() return False return True 结尾的文件和ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'PRC_UPD_PRODUCT_VANILLA' ORA-06550: line 1, column 7: PL/SQL: Statement ignored 中的文件,因为自从升级到Rails 5.2.1以来,不再安装dev依赖项,这会破坏构建,因为spec文件是寻找不存在的开发依赖项。

不过,我确实需要包括所有以.spec.ts结尾的内容(根据角度社区准则,它们与以spec/javascript结尾的目录相同)。

我看到webpacker会自动遍历传递到.ts的目录,所以我不能在那里指定自己的路径(即我真正想要的路径是.spec.ts,而不仅仅是resolved_paths) 。我还尝试将app/assets/angular/**/*[^spec].ts添加到app/assets/angular/**/*列表中,希望webpacker会生成类似[^spec].ts的路径,但不会。

如何告诉webpacker仅加载extensions中不以app/assets/angular/**/*[^spec].ts结尾的.ts个文件?

总结一下我尝试过的app/assets/angular配置:

.spec.ts

webpacker.yml

这些都不起作用。是否有一种配置可以告诉webpacker仅在production: # ... other config resolved_paths: ['app/assets/angular/**/*[^spec].ts'] extensions: - .ts 中包含{em>不中包含production: # ... other config resolved_paths: ['app/assets/angular'] extensions: - '[^spec].ts' 的{​​{1}}文件?

0 个答案:

没有答案