Directly return template without namespace with commonjs

When commonjs set to true and namespace set to false directly return template without namespace.